I am writing an Authorize filter attribute adn I\'m having trouble figuring out how to get the current url as a string so I can pass it as a parameter to the LogOn action. The g
This is the highest ranked result on Google so in Asp.net Core 2.0 this is how I'm doing it:
context.HttpContext.Request.Url();
using this extension method:
///
/// Returns the absolute url.
///
public static string Url(this HttpRequest request)
{
return $"{request.Scheme}://{request.Host}{request.Path}{request.QueryString}";
}