From ec19d71c406f88ab9fc4f61c98f4ef4da63f0caf Mon Sep 17 00:00:00 2001 From: Mark J Price Date: Wed, 15 Feb 2023 11:36:12 +0000 Subject: [PATCH] Update improvements.md --- docs/errata/improvements.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/errata/improvements.md b/docs/errata/improvements.md index 24df6aa..b238324 100644 --- a/docs/errata/improvements.md +++ b/docs/errata/improvements.md @@ -132,3 +132,9 @@ And create a view that matches the name `CategoryDetail.cshtml`, as shown in the ``` > Note: You could also use the simpler link format `https://localhost:5001/home/category/1` but then both the action method and the view filename must be just `Category` instead of `CategoryDetail`. + +If you want to keep the original link format, then you would need to decorate the action method as shown in the following code: +```cs +[Route("category/{id}")] +public async Task CategoryDetail(int? id) +```