HttpContext.Current.Server.UrlEncode
It\'s only work in .NET Framework. How can I encode or decode uri arguments in ASP.NET Core project?
It's available on version 2.0.0 of the .Net Core SDK, in System.Net.WebUtility.UrlEncode (see documentation)
System.Net.WebUtility.UrlEncode