Skip to content

Commit 38694c4

Browse files
committed
Introduced area-based routes
In OnTopic 5, we introduced improved support for area routing (66c53c9) with the new `MapImplicitAreaControllerRoute()` (8a65c95, f41b76a), `MapDefaultAreaControllerRoute()` (35cdd74), and `MapTopicAreaRoute()` (6c6ad74, 762d229). These were never added to the default configuration for the `Host` project, however. Strictly speaking, they aren't necessary since the `Host` project doesn't have any areas configured. Most customers will, however, so it's useful to include these as part of the configuration to demonstrate their use and make them available for boilerplate projects.
1 parent e853ebc commit 38694c4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

OnTopic.AspNetCore.Mvc.Host/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@
6767
/*------------------------------------------------------------------------------------------------------------------------------
6868
| Configure: MVC
6969
\-----------------------------------------------------------------------------------------------------------------------------*/
70-
app.MapTopicErrors("Error"); // Error/{statusCode}
70+
app.MapImplicitAreaControllerRoute(); // {area:exists}/{action=Index}
71+
app.MapDefaultAreaControllerRoute(); // {area:exists}/{controller}/{action=Index}/{id?}
72+
app.MapTopicAreaRoute(); // {area:exists}/{**path}
7173
app.MapDefaultControllerRoute(); // {controller=Home}/{action=Index}/{id?}
7274
app.MapTopicRoute("Web"); // Web/{**path}
7375
app.MapTopicRoute("Error"); // Error/{**path}

0 commit comments

Comments
 (0)