Conventional Routing

noun

say it: “kun-VEN-shuh-nul ROW-ting” /kənˈvɛnʃənəl ˈraʊtɪŋ/

Building every address in an MVC app from one pattern, such as {controller}/{action}/{id?}.

What is Conventional Routing in ASP.NET Core?

Conventional Routing — One URL pattern, set in Program.cs, that every controller follows: /Products/Details/7 reaches ProductsController.Details(7). New controllers and actions get addresses with no routing code of their own.

app.MapControllerRoute(
    name: "default",
    pattern: "{controller=Home}/{action=Index}/{id?}");

In a sentence

  • “Thanks to conventional routing, /Products/Details/7 reaches Details(7) with no route attribute.”

Level: Journeyman · More ASP.NET Core terms at this level

Updated