Deserialization using Json.NET

Download .net eBook

Example

internal class Sequence{
    public string Name;
    public List<int> Numbers;
}    

// ...

string rawJSON = "{\"Name\":\"Fibonacci Sequence\",\"Numbers\":[0, 1, 1, 2, 3, 5, 8, 13]}";

Sequence sequence = JsonConvert.DeserializeObject<Sequence>(rawJSON);

For more information, refer to the Json.NET official site.

Note: Json.NET supports .NET version 2 and higher.

Stats

Contributors: 1
2017-02-15
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook