In shorthand, it goes like this:
This, will de-serialize your JSON string to a generic object, but going from this to get a value well within the structure of a JSON string is quite messy:
This is the code of getting the avatar of a disqus user. Messy, unprofessional, difficult to maintain, difficult to read and much more…
Fortunately there is a better and easier way!
There is this site http://json2csharp.com/ by Jonathan Keith. It uses JSON C# Class Generator to “convert” your JSON string to a series of generic collections of classes with public properties the named keys of your JSON string.
You then just add these classes to your project and cast your JSON string to “RootObject”. Here is the code oding the same job as above: