feito fork de Teknikode/Teknik
1
0
Fork 0
Ver código fonte

Fixed dev routing

master
Teknikode 7 anos atrás
pai
commit
6c37129a32
  1. 6
      Teknik/Areas/About/AboutAreaRegistration.cs
  2. 6
      Teknik/Areas/Blog/BlogAreaRegistration.cs
  3. 8
      Teknik/Areas/Dev/DevAreaRegistration.cs
  4. 8
      Teknik/Areas/Home/HomeAreaRegistration.cs

6
Teknik/Areas/About/AboutAreaRegistration.cs

@ -14,6 +14,12 @@ namespace Teknik.Areas.About @@ -14,6 +14,12 @@ namespace Teknik.Areas.About
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapSubdomainRoute(
"About_dev", // Route name
"dev",
"About/{controller}/{action}", // URL with parameters
new { area = "About", controller = "About", action = "Index" } // Parameter defaults
);
context.MapSubdomainRoute(
"About_default", // Route name
"about",

6
Teknik/Areas/Blog/BlogAreaRegistration.cs

@ -20,6 +20,12 @@ namespace Teknik.Areas.Blog @@ -20,6 +20,12 @@ namespace Teknik.Areas.Blog
// "blog/{controller}/{action}/{username}/{page}", // URL with parameters
// new { subdomain = "blog", area = this.AreaName, controller = "Blog", action = "Index", username = UrlParameter.Optional, page = UrlParameter.Optional } // Parameter defaults
// );
context.MapSubdomainRoute(
"Blog_dev", // Route name
"dev",
"Blog/{controller}/{action}", // URL with parameters
new { area = "Blog", controller = "Blog", action = "Index" } // Parameter defaults
);
context.MapSubdomainRoute(
"Blog_default", // Route name
"blog",

8
Teknik/Areas/Dev/DevAreaRegistration.cs

@ -18,7 +18,13 @@ namespace Teknik.Areas.Dev @@ -18,7 +18,13 @@ namespace Teknik.Areas.Dev
context.MapSubdomainRoute(
"Dev_subdomain", // Route name
"dev",
"{area}/{controller}/{action}", // URL with parameters
"Dev/{controller}/{action}", // URL with parameters
new { area = "Dev", controller = "Dev", action = "Index" } // Parameter defaults
);
context.MapSubdomainRoute(
"Dev_default", // Route name
"dev",
"", // URL with parameters
new { area = "Home", controller = "Home", action = "Index" } // Parameter defaults
);
//context.MapRoute(

8
Teknik/Areas/Home/HomeAreaRegistration.cs

@ -17,12 +17,18 @@ namespace Teknik.Areas.Home @@ -17,12 +17,18 @@ namespace Teknik.Areas.Home
{
context.MapSubdomainRoute(
"Home_dev", // Route name
"dev",
"Home/{controller}/{action}", // URL with parameters
new { area = "Home", controller = "Home", action = "Index" } // Parameter defaults
);
context.MapSubdomainRoute(
"Home_subdomain", // Route name
"www",
"{controller}/{action}", // URL with parameters
new { area = this.AreaName, controller = "Home", action = "Index" } // Parameter defaults
);
context.MapSubdomainRoute(
"Home_subdomain", // Route name
"Home_default", // Route name
null,
"{controller}/{action}", // URL with parameters
new { area = this.AreaName, controller = "Home", action = "Index" } // Parameter defaults

Carregando…
Cancelar
Salvar