Since there is no JavaScriptSerializer
, what native implementation can be used to handle this?
I noticed JsonResult
and I can format data to JSON with this, but how do I deserialize?
Or maybe I am missing some dependencies in project.json
?
This question is related to
c#
json
asp.net-core
.net core
using System.Text.Json;
var jsonStr = JsonSerializer.Serialize(MyObject)
var weatherForecast = JsonSerializer.Deserialize<MyObject>(jsonStr);
For more information about excluding properties and nulls check out This Microsoft side
Source: Stackoverflow.com