public static IKernel Init() { var kernel = new StandardKernel(); NinjectCommon.RegisterServices(kernel); return(kernel); }
/// <summary> /// Creates the kernel that will manage your application. /// </summary> /// <returns>The created kernel.</returns> private static IKernel createKernel() { var kernel = new StandardKernel(); try { kernel.Bind <Func <IKernel> >().ToMethod(ctx => () => new Bootstrapper().Kernel); kernel.Bind <IHttpModule>().To <HttpApplicationInitializationHttpModule>(); NinjectCommon.RegisterServices(kernel); return(kernel); } catch { kernel.Dispose(); throw; } }