-
For ASP.NET Core 2.0+ just add
System.Netnamespace –WebUtilityclass is shipped as part ofSystem.Runtime.Extensionsnuget package, that is referenced by default in ASP.NET Core project. -
For the previous version add
Microsoft.AspNetCore.WebUtilitiesnuget package.
Then the WebUtility class will be available for you:
public static class WebUtility
{
public static string UrlDecode(string encodedValue);
public static string UrlEncode(string value);
}