Wednesday, July 15, 2015

When do you use JSON.Net?

JSON is JavaScript Object Notation. You can read all about JSON by reviewing the following:

What is JSON?:

Working with JSON:

SQL response in JSON:

Let us take this fruit (object) which has,
fruit should be used before (Expiry)=12/28/2008
Sizes=small, big, extra large

This object can be represented it in JSON as:
"Name": "Apple",
"Expiry": "2008-12-28T00:00:00",
"Sizes": [

JSON.NET is a high-performance JSON Framework for .NET.

You can read all about JSON.NET here.

The benefits of using JSON.NET are the following (quoted from the above site):

  • Flexible JSON serializer for converting between .NET objects and JSON
  • LINQ to JSON for manually reading and writing JSON
  • High performance: faster than .NET's built-in JSON serializers
  • Write indented, easy-to-read JSON
  • Convert JSON to and from XML
  • Supports .NET 2, .NET 3.5, .NET 4, .NET 4.5, Silverlight, Windows Phone and Windows 8 Store
 In order to use it in your .NET project you need to add a reference to NewtonSoft.JSON

No comments: