예제 #1
0
 public override void Activate(FeaturesBootstrapContext ctx)
 {
     if (Bootstrapper.Kernel == null)
     {
         Bootstrapper.Initialize(CreateKernel);
     }
     if (ctx != null)
     {
         var kernel = Bootstrapper.Kernel;
         ctx.Set<IKernel>(kernel);
         ctx.Set<IServiceCollection>(new NInjectServiceCollection(kernel));
     }
 }
예제 #2
0
 public void Start(params object[] services)
 {
     var ctx = new FeaturesBootstrapContext();
     ctx.Set(services);
     OnStart(ctx);
     Activate(ctx);
     FeaturesBootstrapContext = ctx;
 }
예제 #3
0
 private static void OnRegisteredServices(IServiceCollection services, FeaturesBootstrapContext ctx)
 {
     var serviceProvider = services.BuildServiceProvider();
     ctx.Set(serviceProvider);
 }
예제 #4
0
 private void Activate(FeaturesBootstrapContext ctx, HttpConfiguration config)
 {
     ctx.Set(config);
     base.Activate(ctx);
 }