diff --git a/UrlsAndRoutes/UrlsAndRoutes.Tests/RouteTests.cs b/UrlsAndRoutes/UrlsAndRoutes.Tests/RouteTests.cs index f46d0ea..097e115 100644 --- a/UrlsAndRoutes/UrlsAndRoutes.Tests/RouteTests.cs +++ b/UrlsAndRoutes/UrlsAndRoutes.Tests/RouteTests.cs @@ -103,6 +103,7 @@ namespace UrlsAndRoutes.Tests TestRouteMatch("~/Customer", "Customer", "Index"); TestRouteMatch("~/Customer/List", "Customer", "List"); TestRouteFail("~/Customer/List/All"); + TestRouteMatch("~/Shop/Index", "Home", "Index"); } } } diff --git a/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs b/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs index 4b2a14a..c461097 100644 --- a/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs +++ b/UrlsAndRoutes/UrlsAndRoutes/App_Start/RouteConfig.cs @@ -11,6 +11,9 @@ namespace UrlsAndRoutes { public static void RegisterRoutes(RouteCollection routes) { + routes.MapRoute("ShopSchema2", "Shop/OldAction", + new { controller = "Home", action = "Index" }); + routes.MapRoute("ShopSchema", "Shop/{action}", new { controller = "Home" });