Tuesday, January 21, 2020

We are back to Newtonsoft in .NET Core kids!

There is no JavaScriptSerializer in the .NET Core stuff. :( Stack Overflow recommends using Newtonsoft. Import it like so:

using Newtonsoft.Json;

 
 

Turn around and use it like this:

object o = JsonConvert.DeserializeObject(json1);
string json2 = JsonConvert.SerializeObject(o, Formatting.Indented);

No comments:

Post a Comment