Example #1
0
 public static void Configuration(IAppBuilder app)
 {
     AreaRegistration.RegisterAllAreas();
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     FilterConfig.Configure(GlobalFilters.Filters);
     ConfigureAuth(app);
 }
Example #2
0
 protected void Application_Start(object sender, EventArgs e)
 {
     /*注册区域 要在RouteConfig前面 */
     AreaRegistration.RegisterAllAreas();
     FilterConfig.Configure(GlobalFilters.Filters);
     RouteConfig.Configure(RouteTable.Routes);
 }
Example #3
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var settings = new SettingsAdapter().Create <ISettings>(WebConfigurationManager.AppSettings);

            FilterConfig.Configure(GlobalFilters.Filters);
            RouteConfig.Configure(RouteTable.Routes);
            ControllerBuilder.Current.SetControllerFactory(new Mvc.CustomControllerFactory(settings));
            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new FeatureBasedRazorViewEngine());
        }
        protected void Application_Start(object sender, EventArgs e)
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.Configure(GlobalFilters.Filters);
            RouteConfig.Configure(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            var lIfacade = RegisterInterfaces.RegisTerFacade();

            FacadeProvider.FacadeProviderInstance = lIfacade.RegisterFacadeProvider();
        }
Example #5
0
        public void Configuration(IAppBuilder app)
        {
            // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888

            app.UseCookieAuthentication(new Microsoft.Owin.Security.Cookies.CookieAuthenticationOptions
            {
                ReturnUrlParameter = "returnUrl",
                AuthenticationType = "ApplicationCookie",
                CookieName         = "EmailLog",
                LoginPath          = new PathString("/Auth/Login")
            });

            FilterConfig.Configure(GlobalFilters.Filters);
        }
Example #6
0
        public void Configuration(IAppBuilder app)
        {
            // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=316888

            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            FilterConfig.Configure(GlobalFilters.Filters);
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                ReturnUrlParameter = "returnUrl",
                AuthenticationType = "ApplicationCookie",
                CookieName         = "LoggingEmailApp",
                LoginPath          = new PathString("/Auth/Login")
            });
        }
Example #7
0
        public static void Register(HttpConfiguration config)
        {
            // Web API configuration and services
            //DI
            var container = new UnityContainer();

            container.RegisterType <OAuthServerDataContext, OAuthServerDataContext>(new HierarchicalLifetimeManager());
            container.RegisterType <IUserRepository, UserRepository>(new HierarchicalLifetimeManager());
            config.DependencyResolver = new UnityResolver(container);

            // Web API routes
            config.MapHttpAttributeRoutes();

            config.Filters.Add(new AuthorizeAttribute());

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );

            FilterConfig.Configure(config);
        }
Example #8
0
 protected void Application_Start(object sender, EventArgs e)
 {
     FilterConfig.Configure(GlobalFilters.Filters);
     RouteConfig.Configure(RouteTable.Routes);
 }
Example #9
0
 protected void Application_Start()
 {
     // AreaRegistration.RegisterAllAreas();
     //// RouteConfig.RegisterRoutes(RouteTable.Routes);
     FilterConfig.Configure(GlobalFilters.Filters);
 }