-
To create a class off a json string, copy the string.
-
In Visual Studio, in the menu at the top, click Edit > Paste special > Paste Json as classes.
-
Install Newtonsoft.Json via Nuget
-
Paste the following code into your project, “jsonString” being the variable you want to deserialize :
Rootobject r = Newtonsoft.Json.JsonConvert.DeserializeObject<Rootobject>(jsonString);
-
Don’t forget to rename Rootobject to be more descriptive eg
ILoveTheSmellOfNapalmInTheMorning
-that was a joke