コード例 #1
0
        public override void RegisterArea(AreaRegistrationContext context)
        {
            // map /admin/products/123
            context.MapLowercaseRoute(
                "Admin_view",
                "Admin/{controller}/{id}",
                new { controller = "Home", action = "View" },
                new { id = @"\d+" });

            // map /admin/products/edit/123
            context.MapLowercaseRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                new { action = @"^\D.*" });
        }
コード例 #2
0
 public static Route MapLowercaseRoute(
     this AreaRegistrationContext context,
     string name,
     string url)
 {
     return(context.MapLowercaseRoute(
                name, url, null));
 }
コード例 #3
0
 public override void RegisterArea(AreaRegistrationContext context)
 {
     context.MapLowercaseRoute(
         "Admin_default",
         "Admin/{controller}/{action}/{id}",
         new { action = "Index", id = UrlParameter.Optional },
         new[] { "Groupr.Mvc.Areas.Admin.Controllers" }
         );
 }
コード例 #4
0
 public static Route MapLowercaseRoute(
     this AreaRegistrationContext context,
     string name,
     string url,
     object defaults,
     string[] namespaces)
 {
     return(context.MapLowercaseRoute(
                name, url, defaults, null, namespaces));
 }
コード例 #5
0
 public static Route MapLowercaseRoute(
     this AreaRegistrationContext context,
     string name,
     string url,
     object defaults,
     object constraints)
 {
     return(context.MapLowercaseRoute(
                name, url, defaults, constraints, null));
 }