extension for ninject providing integration with ASP.NET MVC
C# ASP CSS Shell
Latest commit e0bda7f Apr 26, 2014 @iappert iappert Adapted scripts to mono 3.4


This extension allows integration between the Ninject core 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

  public override IKernel CreateKernel()
    return new StandardKernel(new SomeModule(), new SomeOtherModule(), ...);

    // OR, to automatically load modules:

    var kernel = new StandardKernel();
    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.