protected void Application_Start() { AreaRegistration.RegisterAllAreas(); DependencyConfigure.Initialize(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); }
protected void Application_Start() { DependencyConfigure.Initialize(GlobalConfiguration.Configuration); AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); // DependencyConfigure.Initialize(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); GlobalConfiguration.Configure(WebApiConfig.Register); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); Database.SetInitializer(new DropCreateDatabaseIfModelChanges <DataContext>()); DependencyConfigure.Initialize(); ModelBinders.Binders.Add(typeof(Сart), new CartModelBinder()); }
protected void Application_Start() { //配置log4net日志 log4net.Config.XmlConfigurator.Configure(new FileInfo(Server.MapPath("log4net.config"))); //CacheManager.RedisHelper.DeleteAllKeys(); DbConfiguration.SetConfiguration(new MySqlEFConfiguration()); Database.SetInitializer <MVCBlogContext>(new DropCreateDatabaseIfModelChanges <MVCBlogContext>()); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); AreaRegistration.RegisterAllAreas(); DependencyConfigure.Initialize(); RouteConfig.RegisterRoutes(RouteTable.Routes); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true); DependencyConfigure.Initialize(typeof(MvcApplication)); var builder = new ContainerBuilder(); builder.RegisterAssemblyTypes(typeof(MvcApplication).Assembly).PropertiesAutowired(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); ModuleViewEnginsConfig.RegisterAllEngins(); CustomValidatorsConfig.Register(); DependencyConfigure.Initialize(); ModelBinderProviders.BinderProviders.Add(new YourModelBinderProvider()); var dirs = System.IO.Directory.GetFiles(Server.MapPath("~/T-SQL")); using (var context = ApplicationContext.UpdateMigration()) { foreach (var item in dirs) { context.Database.ExecuteSqlCommand(System.IO.File.ReadAllText(item)); } } }