doc update for anchor tag helper (#23480)

pull/23488/head
Fiyaz Bin Hasan 2021-10-07 23:32:18 +06:00 committed by GitHub
parent 1b3a00f5c6
commit 932e9608a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -64,7 +64,7 @@ The [asp-route-{value}](xref:Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper
Consider the following controller action:
[!code-csharp[](samples/TagHelpersBuiltIn/Controllers/BuiltInTagController.cs?name=snippet_AnchorTagHelperAction)]
[!code-csharp[](samples/TagHelpersBuiltIn/Controllers/SpeakerController.cs?name=snippet_SpeakerDetailAction)]
With a default route template defined in *Startup.Configure*:

View File

@ -7,6 +7,7 @@
public class SpeakerController : Controller
{
#region snippet_SpeakerDetailAction
private List<Speaker> Speakers =
new List<Speaker>
{
@ -18,6 +19,7 @@
[Route("Speaker/{id:int}")]
public IActionResult Detail(int id) =>
View(Speakers.FirstOrDefault(a => a.SpeakerId == id));
#endregion
[Route("/Speaker/Evaluations",
Name = "speakerevals")]