diff --git a/aspnetcore/fundamentals/routing/samples/6.x/RoutingSample/Snippets/Controllers/WidgetController.cs b/aspnetcore/fundamentals/routing/samples/6.x/RoutingSample/Snippets/Controllers/WidgetController.cs index 29e70f8230..61ffd263c0 100644 --- a/aspnetcore/fundamentals/routing/samples/6.x/RoutingSample/Snippets/Controllers/WidgetController.cs +++ b/aspnetcore/fundamentals/routing/samples/6.x/RoutingSample/Snippets/Controllers/WidgetController.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; namespace RoutingSample.Snippets.Controllers; @@ -35,9 +35,9 @@ public class WidgetController : ControllerBase { // var subscribePath = _linkGenerator.GetPathByAction( - "Subscribe", null!, new { id = 17 })!; + HttpContext, "Subscribe", null, new { id = 17 }); // - return Content(subscribePath); + return Content(subscribePath!); } }