What is the equivalent in Asp.Net Core of the old HttpContext.Request.UserHostAddress?
I tried this.ActionContext.HttpContext but cannot fi
HttpRequest.UserHostAddress gives the IP address of the remote client. In ASP.NET Core 1.0, you have to use the HTTP connection feature to get the same. HttpContext has the GetFeature method that you can use to get a specific feature. As an example, if you want to retrieve the remote IP address from a controller action method, you can do something like this.
var connectionFeature = Context
.GetFeature();
if (connectionFeature != null)
{
string ip = connectionFeature.RemoteIpAddress.ToString();
}