Ninject Conditional Self bind to change scope (For Task-scheduler) not working properly?
问题 Within MVC Web Application DbContext binding work properly with InRequestScope() kernel.Bind<DbContext>().ToSelf().InRequestScope(); kernel.Bind<IUnitOfWork<DbContext>>().To<UnitOfWork<DbContext>>(); But from a Task Scheduler call DbContext in InRequestScope() unable to update Db Table ( without any error ), until I change Binding to InSingletonScope() OR InThreadScope() Question: So is their any way change scope to InSingletonScope() / InThreadScope() for a Task Scheduler Call. ? // For Task