How it works...

After you run your console application, you can view the file created by the JSON serializer.

The results of the class average calculation on the class and from the LINQ query on the JSON object are exactly the same.

Lastly, the deserialized object from the JSON text in the file can be seen when adding a break point to the code and inspecting the funProg object. As you can see, the object state is the same as before it was serialized to the file.

Do you remember at the beginning of this recipe I mentioned that JSON produces much less data than XML? I created the Student class containing 10,000 students in  List<Student> and serialized using XML and JSON. The comparison between the two file sizes is quite stunning. JSON clearly produces a much smaller file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.18.141