Env: C# Core 3.1 WebApi Project.
In my controller I'm trying to get the current URL but am getting a null value. I've tried a number of things using the Url class:
var x = Url.Link("https://localhost:44397/api/Account/Accounts/", new { a = 1, b = 2 });
var y = Url.RouteUrl("www.xyz.com", new { a = 3, b = 4 });
var url = Url.Link("GetAuthors", authorsResourceParameters);
var r = Url.RouteUrl("This route");
var yd = Url.Action("myAction", "myController", authorsResourceParameters, "https");
The Url class is from Microsoft.AspNetCore.Mvc.Routing.EndpointRoutingUrlHelper. Is this the correct namespace?
What am I missing?