I am trying to figure out how to get runtime parameters setting using IOC setup in MVC4.
I have not selected an IOC framework yet and am happy to take suggestions. I would prefer to avoid NInject, as I have heard that it is fairly slow.
I need to specify my IOC After login. So I am thinking that I need to create a FilterAction that will handle this. Is this the best place to do the IOC or is there a better place?
I have seen a lot of IOC examples that do the specification at design time and I but I could not find anything that made the IOC container via a filterAction or some other sort of post-login event.
Any help would be appreciated.
Ideally you should write a custom
IDependencyResolveryour your favorite DI framework. This resolver will be used by ASP.NET MVC to inject dependencies into common structures such as controllers. And to avoid reinventing the wheels search for a DI framework which already has an MVC extension to id adding this dependency resolver (probably the NuGet package will be suffixed with.MVC, for exampleUnity.Mvc3orNinject.Mvc3, …). The container setup is then performed in yourApplication_Start.