Skip to content

Instantly share code, notes, and snippets.

@vquaiato
Created January 31, 2011 23:05
Show Gist options
  • Save vquaiato/805024 to your computer and use it in GitHub Desktop.
Save vquaiato/805024 to your computer and use it in GitHub Desktop.
Arquivo criado pelo NuGet no install do Ninject.MVC3
using System.Web.Mvc;
using Ninject;
using Ninject.Mvc3;
[assembly: WebActivator.PreApplicationStartMethod(typeof(MvcApplication1.AppStart_NinjectMVC3), "Start")]
namespace MvcApplication1 {
public static class AppStart_NinjectMVC3 {
public static void RegisterServices(IKernel kernel) {
//kernel.Bind<IThingRepository>().To<SqlThingRepository>();
}
public static void Start() {
// Create Ninject DI Kernel
IKernel kernel = new StandardKernel();
// Register services with our Ninject DI Container
RegisterServices(kernel);
// Tell ASP.NET MVC 3 to use our Ninject DI Container
DependencyResolver.SetResolver(new NinjectServiceLocator(kernel));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment