Resolving type with PerRequestLifetimeManager without HTTP request
I have a MVC application that uses IoC with Unity and I have a DbContext implementation defined using the PerRequestLifetimeManager . This object is injected to controllers through Unit of Work implementation. container.RegisterType<DBContext, MyContext>(new PerRequestLifetimeManager()); Everything is working fine so far and the app has a decent number of models and controllers. Now what I was trying to do recently is add some automated tasks for this application and for this purpose I wanted to use HangFire . I've set up this library in my project and created a simple task in which I want to