0

I am trying to rewrite this line of code HttpContext.Current.Request.ServerVariables["HTTP_HOST"] it cant find current it doesn't contain a definition.

jps
  • 15,760
  • 14
  • 59
  • 71
Spafa9
  • 692
  • 3
  • 13
  • 29

1 Answers1

0

There is an extension in .net core. To use it you need to install prerequested package which denoted below.

https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpcontextservervariableextensions.getservervariable?view=aspnetcore-5.0

Ulas
  • 9
  • 4