From 63f7bebb609de5bd62fa2684125c462fc76f1681 Mon Sep 17 00:00:00 2001 From: Olcay Bayram Date: Wed, 25 Oct 2017 17:31:06 +0200 Subject: [PATCH] Adding optional id parameter to area route (#4628) --- aspnetcore/mvc/controllers/areas.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aspnetcore/mvc/controllers/areas.md b/aspnetcore/mvc/controllers/areas.md index 1968342173..bcdac2acbc 100644 --- a/aspnetcore/mvc/controllers/areas.md +++ b/aspnetcore/mvc/controllers/areas.md @@ -128,8 +128,9 @@ Set up a route definition that works with your newly created areas. The [Routing ... app.UseMvc(routes => { - routes.MapRoute(name: "areaRoute", - template: "{area:exists}/{controller=Home}/{action=Index}"); + routes.MapRoute( + name: "areaRoute", + template: "{area:exists}/{controller=Home}/{action=Index}/{id?}"); routes.MapRoute( name: "default",