I am currently migrating MVC Project to Asp.Net Core Project where in Layout page i used one piece of code to get the current base url.
e.g: If i run MVC application hosted in IIS server then i used Virtual directory to have the MVC application like below:
https://mydomain/myMVCApplication/Login
Then using below code in view i can get the Url till Virtual directory
https://mydomain/myMVCApplication/
var baseUrl = @Html.Raw(System.Web.HttpUtility.JavaScriptStringEncode(new Uri(new Uri(this.Context.Request.Url.GetLeftPart(UriPartial.Authority)), Url.Content("~/")).ToString(), true));
But when migrate in asp.net core view then Here Context.Request.Url where Url is not a property of Context.Request.
Please suggest here to fix above issue and get the same result.