public
Description: extension for ninject providing integration with ASP.NET MVC
Homepage: http://ninject.org/
Clone URL: git://github.com/enkari/ninject.web.mvc.git
name age message
file .gitignore Mon May 11 08:41:54 -0700 2009 HttpApplication is now injected [nkohari]
file Ninject.Web.Mvc.sln Mon Mar 16 15:02:25 -0700 2009 Updated readme [nkohari]
file Ninject.Web.Mvc.sln.cache Mon Mar 16 14:08:31 -0700 2009 Updated to latest version of core [nkohari]
file README.markdown Wed Mar 18 06:02:48 -0700 2009 Upgrade to 1.0 of ASP.NET MVC [nkohari]
directory lib/ Sat Aug 22 08:53:51 -0700 2009 Applied patch from Ian Davis for fixing 404 err... [unknown]
directory src/ Sat Aug 22 08:53:51 -0700 2009 Applied patch from Ian Davis for fixing 404 err... [unknown]
README.markdown

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()
  {
    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.