Ejemplo n.º 1
0
        public static IKernel Init()
        {
            var kernel = new StandardKernel();

            NinjectCommon.RegisterServices(kernel);

            return(kernel);
        }
Ejemplo n.º 2
0
        /// <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;
            }
        }