Hi guys,
We're using Ninject for both Web project and Azure WebJob for background worker. Not so long ago I realized that WebJob crashes with out of memory exception every once in a while.
Datacontext is bound into WebJob in Thread Scope:
Bind<EntitiesContext>()
.ToMethod(context => new EntitiesContext())
.InThreadScope();
So I tried using NamedScope extension with InCallScope - no luck.
It might be helpful to say that when I wrap datacontext inside using memory is being released:
using(var db = new dataContext) {
var temp = db.Users;
}
But when I do the same with Repository memory stays on the same level.
I would appreciate any ideas.