Example #1
0
        private IKernel RegisterApplicationComponents(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            Kernel = new StandardKernel();

            // Register application services
            //config.Bind(app.GetControllerTypes()).ToSelf().InScope(RequestScope);

            //my own
            Kernel.BindTypiconServices(Configuration);

            // Cross-wire required framework services
            Kernel.BindToMethod(app.GetRequestService <IViewBufferScope>);
            Kernel.Bind <ILoggerFactory>().ToConstant(loggerFactory);

            return(Kernel);
        }
Example #2
0
        internal IKernel RegisterApplicationComponents(IApplicationBuilder app, ILoggerFactory loggerFactory)
        {
            // IKernelConfiguration config = new KernelConfiguration();
            Kernel = new StandardKernel();

            // Register application services
            foreach (var ctrlType in app.GetControllerTypes())
            {
                Kernel.Bind(ctrlType).ToSelf().InScope(RequestScope);
            }

            bindServices();

            // Cross-wire required framework services
            Kernel.BindToMethod(app.GetRequestService <IViewBufferScope>);
            Kernel.Bind <ILoggerFactory>().ToConstant(loggerFactory);

            return(Kernel);
        }