示例#1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //初始化全局配置缓存信息
            SysConfigsCache.Register();
        }
示例#2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            log4net.Config.XmlConfigurator.Configure(new FileInfo(Server.MapPath("~/log4net.config")));

            //初始化全局配置缓存信息
            SysConfigsCache.Register();

            //权限缓存
            using (EFDbContext context = new EFDbContext())
            {
                PermissionCache.time = DateTime.Now;
                PermissionCache.ResetPermissionCache(
                    context.Permissions.ToList(),
                    context.UserRoles.ToList(),
                    context.RolePermissions.ToList());
            }
        }