Serialization-Deserialization using Newtonsoft.Json
suggest changeUnlike the other helpers, this one uses static class helpers to serialize and deserialize, hence it is a little bit easier than the others to use.
using Newtonsoft.Json; var rawJSON = "{\"Name\":\"Fibonacci Sequence\",\"Numbers\":[0, 1, 1, 2, 3, 5, 8, 13]}"; var fibo = JsonConvert.DeserializeObject<Dictionary<string, object>>(rawJSON); var rawJSON2 = JsonConvert.SerializeObject(fibo);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents