Skip to content

Instantly share code, notes, and snippets.

@yesez
Created May 6, 2013 03:42
Show Gist options
  • Save yesez/5523238 to your computer and use it in GitHub Desktop.
Save yesez/5523238 to your computer and use it in GitHub Desktop.
private static IKernel CreateKernel()
{
var kernel = new StandardKernel();
kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
RegisterServices(kernel);
//Integrar Ninject como Dependency Resolver en la Config. a nivel Global.
GlobalConfiguration.Configuration.DependencyResolver = new NinjectDependencyResolver(kernel);
return kernel;
}
private static void RegisterServices(IKernel kernel)
{
kernel.Bind<IPaisRepository>().To<PaisRepository>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment