Rebel.Cms.Web.Mvc.Areas.RebelAreaRegistration.MapRouteBackOffice C# (CSharp) Method

MapRouteBackOffice() private method

The standard routes for the back office main pages
private MapRouteBackOffice ( RouteCollection routes ) : void
routes RouteCollection
return void
        private void MapRouteBackOffice(RouteCollection routes)
        {
            //url to match deep linked apps (i.e. /Rebel or /Rebel/Media)
            var defaultControllerName = RebelController.GetControllerName(typeof(DefaultController));
            var appRoute = routes.MapRoute(
                ApplicationRouteName,
                AreaName + "/{appAlias}",
                new { controller = defaultControllerName, action = "App", appAlias = "content" },
                new { backOffice = new BackOfficeRouteConstraint(_applicationContext) },
                new[] { typeof(DefaultController).Namespace });//match controllers in these namespaces                
            appRoute.DataTokens.Add("area", AreaName);//only match this area
            appRoute.DataTokens.Add("rebel", "backoffice"); //ensure the rebel token is set

            //url to match normal controller routes for the back office
            var standardRoute = routes.MapRoute(
                DefaultRouteName,
                AreaName + "/{controller}/{action}/{id}",
                new { controller = defaultControllerName, action = "Index", id = UrlParameter.Optional },
                new { backOffice = new BackOfficeRouteConstraint(_applicationContext) },
                new[] { typeof(DefaultController).Namespace });//match controllers in these namespaces                
            standardRoute.DataTokens.Add("area", AreaName);//only match this area
            standardRoute.DataTokens.Add("rebel", "backoffice"); //ensure the rebel token is set
        }