Serializing and deserializing JSON
In recent times, JavaScript Object Notation (JSON) has become the de facto standard for data serialization, not only for web and mobile but also for desktop. .NET did not provide a proper library for serializing and deserializing JSON; therefore, developers have resorted to third-party libraries. One of these libraries is Json.NET (also known as Newtonsoft.Json, after its creator, Newton-King). This has become the preferred library for most .NET developers and a dependency of ASP.NET Core. However, with the release of .NET Core 3.0, Microsoft is providing its own JSON serializer, known as System.Text.Json, after the namespace where it is available. In this last part of this chapter, we will look at these two libraries and see some of their capabilities and how they compare to each other.
Using Json.NET
Json.NET is currently the most widely used .NET library for JSON serialization and deserialization. It's a high-performance, easy-to-use...