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); }
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); }