I have an Azure Worker role that needs a repository. I usually use Ninject to inject these things into the constructor of the objects that I create, which works fine for MVC3 / 4 (I use it with Ninject.MVC).
However, it does not work with Azure worker roles. I need a constructor without parameters to run the role, so installing the constructor is not an option. I tried using DependencyResolver.Current.GetService to get my repository (from the constructor, from the OnStart() method and from the Run() method), but it returns null every time. I think this is because Application_Start() from MVC is not running yet? I dont know.
Can someone help me by explaining how I do this? Is anyone
source share