HttpContext.Current.Server.UrlEncode
Só funciona no .NET Framework. Como posso codificar ou decodificar argumentos uri no projeto ASP.NET Core?
HttpContext.Currentmas HttpContextfaz parte do .Net Core - Microsoft.AspNetCore.Http.HttpContext. Lembre-se disso