I am porting a .Net framework built MVC application to .Net Core 3.1 and I have a case where System.Web.Helpers.Json.Encode()
methods have been used.
As System.Web.Helpers
is not available in .Net Core, any idea what alternate to use?
I am porting a .Net framework built MVC application to .Net Core 3.1 and I have a case where System.Web.Helpers.Json.Encode()
methods have been used.
As System.Web.Helpers
is not available in .Net Core, any idea what alternate to use?
You can use the built-in json serializer (System.Text.Json)
var obj = getMyObject();
var json = JsonSerializer.Serialize(obj);
You can use the following way: