Beispiel #1
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     GlobalConfiguration.Configure(WebApiConfig.Register);
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     InjectionConfig.Configure();
 }
Beispiel #2
0
        public void Configuration(IAppBuilder app)
        {
            //app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);

            var container = InjectionConfig.Configure();

            MappingConfig.Register();
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);

            InjectionConfig.Configure(services);
            GlobalExceptionHandlerMiddlewareExtensions.AddGlobalExceptionHandlerMiddleware(services);

            services.AddDbContext <DatabaseContext>(options =>
                                                    options.UseSqlServer(Configuration.GetConnectionString("DatabaseContext")));
        }