public NInjectServiceProvider Build() { var result = new NInjectServiceProvider(_kernel); _kernel.Bind <IServiceProvider>().ToConstant(result); // needed for factory methods in IServiceCollection _kernel.Populate(_services); return(result); }
public void ConfigureServices(IServiceCollection services) { Kernel = new StandardKernel(); Kernel.Populate(Bootstrapper); }
public static void Populate(this IKernel kernel, IEnumerable <IServiceDescriptor> descriptors) { kernel.Populate(descriptors, fallbackServiceProvider: null); }