Skip to content

Instantly share code, notes, and snippets.

@kmckelvin
Created August 28, 2010 14:34
Show Gist options
  • Save kmckelvin/555195 to your computer and use it in GitHub Desktop.
Save kmckelvin/555195 to your computer and use it in GitHub Desktop.
public class MusicStoreNinjectModule : NinjectModule
{
public override void Load()
{
Bind<AccountController>().ToSelf();
Bind<CheckoutController>().ToSelf();
Bind<HomeController>().ToSelf();
Bind<ShoppingCartController>().ToSelf();
Bind<StoreController>().ToSelf();
Bind<StoreManagerController>().ToSelf();
// This will be injected into our controller to give us access to our context
// without introducing a tight coupling to a static resource.
Bind<IMusicStoreContext>().ToMethod(c => MvcApplication.GetCurrentRequestContext());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment