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 ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.