.NET Framework JSON Serialization Deserialization using Json.NET

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

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.



Got any .NET Framework Question?