I am trying to add a root path as a parameter in a View, so I can pass it as a parameter to a PayPal button.
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_top">
... snip ...
<input type="hidden" name="return" value="@Model.UrlRoot/Manage/Subscription?userId=@Model.User.Id">
... snip ...
</form>
I was sifting through the answers at How can I get my webapp's base URL in ASP.NET MVC? (20 answers) and ASP.NET MVC 6 application's virtual application root path
Since ASP.NET Core is quite different, the Request class no longer contains a .Url property, so most of those answers don't work.