Monday 24 September 2018

c# - How to deserialize with JSON.NET?




How do I setup Newtonsoft Json.net to deserialize this text into a .NET object?



[
[
"US\/Hawaii",
"GMT-10:00 - Hawaii"
],
[
"US\/Alaska",

"GMT-09:00 - Alaska"
],
]


For bonus points, what is this kind of structure called in Json. I tried looking for anonymous objects, but didn't have any luck.


Answer



JSON.Net uses JArray to allow these to be parsed - see:





No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...