protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); Database.SetInitializer(new MigrateDatabaseToLatestVersion <DataContext, Configuration>()); AutofacConfig.SetAutofacContainer(); AutoMapperConfig.RegisterMapper(); }
protected void Application_Start() { AutofacConfig.SetAutofacContainer();//初始化依赖注入 AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); Database.SetInitializer(new MigrateDatabaseToLatestVersion <DataContext, Configuration>()); AutoMapperConfig.RegisterMapper(); CustomRaiseEventConfig.ReisgerEvent(); }