0 votes
in JSON by
How to use Newtonsoft or JSON.net for deserializing the JSON data?

1 Answer

0 votes
by
Newtonsoft also provides functionality for deserializing the JSON structure to retrieve the data. The deserialization process is just like the reverse of serialization. Here, the same steps are followed but in reverse order.

At first, we need to store the JSON that we want to deserialize in a string.

string JSON = @"{

"Brand": "Hyundai",

"Name": "Verna",

"Color": “Red”

}

Once we have stored the JSON structure in a string, we will use the following command to deserialize it and to receive different data.

Car m = JsonConvert.DeserializeObject<Car>(JSON);

Now, we will retrieve all the data from the JSON list one by one.

string Brand = m.Brand;

string Name = m.Name;

string Color = m.Color;

Related questions

0 votes
asked Nov 4, 2020 in JSON by rahuljain1
0 votes
asked Jul 20, 2020 in JSON by Robindeniel
...