This extension allows integration between the Ninject and ASP.NET MVC projects. To use it, just make your HttpApplication (typically in Global.asax.cs) extend NinjectHttpApplication:
public class YourWebApplication : NinjectHttpApplication { public override void OnApplicationStarted() { // This is only needed in MVC1 RegisterAllControllersIn("Some.Assembly.Name"); } public override IKernel CreateKernel() { return new StandardKernel(new SomeModule(), new SomeOtherModule(), ...); // OR, to automatically load modules: var kernel = new StandardKernel(); kernel.AutoLoadModules("~/bin"); return kernel; } }
Once you do this, your controllers will be activated via Ninject, meaning you can expose dependencies on their constructors (or properties, or methods) to request injections.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4