Introduction
JSON is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute-value pairs and arrays.
About System.Text.Json
System.Text.Json library provides high-performance and low-allocating types that serialize objects to JavaScript Object Notation (JSON) text and deserialize JSON text to objects, with UTF-8 support built-in. Also provides types to read and write JSON text encoded as UTF-8, and to create an in-memory document object model (DOM), that is read-only, for random access of the JSON elements within a structured view of the data.
Now, let's install and use JSON library in the ASP.NET website.
Install System.Text.Json library from NuGet
To install library, go to "Microsoft Visual Studio 2022" => "Tools" menu => "NuGet Package Manager" => "Manage NuGet Packages for solution", search for "System.Text.Json" and click "Install" as in below picture.

What is JSON Deserialization
Deserialization is the process of parsing a string into an object of a specific type. The JsonSerializer.Deserialize() method converts a JSON string into an object of the type specified by a generic type parameter.
Below is the JSON format that will be used as an example:
string JsonString = @"{
""Version"": 1,
""Key"": ""314929"",
""Type"": ""City"",
""Rank"": 30,
""LocalizedName"": ""Stockholm"",
""EnglishName"": ""Stockholm"",
""PrimaryPostalCode"": """",
""Region"": {
""ID"": ""EUR"",
""LocalizedName"": ""Europe"",
""EnglishName"": ""Europe""
},
""Country"": {
""ID"": ""SE"",
""LocalizedName"": ""Sweden"",
""EnglishName"": ""Sweden""
},
""TimeZone"": {
""Code"": ""CET"",
""Name"": ""Europe/Stockholm"",
""GmtOffset"": 1.0,
""IsDaylightSaving"": false,
""NextOffsetChange"": ""2022-03-27T01:00:00Z""
},
""DataSets"": [
""AirQualityCurrentConditions"",
""AirQualityForecasts"",
""Alerts"",
""DailyPollenForecast"",
""ForecastConfidence"",
""FutureRadar"",
""MinuteCast"",
""Radar""
]
}";

Join the conversation! Your thoughts help the community grow.