示例#1
0
 protected void Application_Start()
 {
     SwaggerConfig.Register(Server);
     AreaRegistration.RegisterAllAreas();
     GlobalConfiguration.Configure(WebApiConfig.Register);
     FilterConfig.RegisterGlobalFilters(GlobalConfiguration.Configuration.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     NinjectConfig.Register();
 }
示例#2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            NinjectConfig.Register(GlobalConfiguration.Configuration, kernel =>
            {
                kernel.Bind <ICardService>().To <TfsCardService>();
            });
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
示例#3
0
        public void Configuration(IAppBuilder app)
        {
            var config = new HttpConfiguration();

            WebApiConfig.Register(config);

            var kernel = CreateKernel();

            NinjectConfig.Register(kernel);

            app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);

            ConfigureOAuth(app, kernel);

            app.UseNinjectMiddleware(() => kernel);
            app.UseNinjectWebApi(config);
        }
示例#4
0
 /// <summary>
 /// Load your modules or register your services here!
 /// </summary>
 /// <param name="kernel">The kernel.</param>
 private static void RegisterServices(IKernel kernel)
 {
     NinjectConfig.Register(kernel);
 }