I am having an issue with EF not updating my object within another thread. I am able to retrieve objects, but when I call UnitOfWork.Commit();
, SQL Server profiler doesnt show the item being updated. If I run this outside of the thread sequentially then it works fine. Any ideas?
new Thread(() =>
{
var divisionBracketsService = DependencyResolver.Current.GetService<IDivisionBracketsService>();
if (divisionBracketsService != null)
divisionBracketsService.ProcessGame(gameId);
}).Start();
UPDATE
Well it worked when I updated the scope to thread. Are there any patterns to use both scopes?
kernel.Bind<IDatabaseFactory>().To<DatabaseFactory>().InThreadScope();
UPDATE
I noticed this question Ninject InRequestScope fallback to InThreadScope, but I am using version 3.0 of Ninject and it doesn't contain StandardScopeCallbacks.Request
.