Luke Lowrey
Luke Lowrey

Reputation: 3205

Json Deserialization to Dictionary .NET

Given json like this:

[
  ["Rating (out of 5)", "3"],
  ["Date taken", "Mon, 03 Mar 2003 03:04:03 GMT"]
]

What is the best way to deserialize it into something like Dictionary<string, string> or should I be using a different data structure?

I'd probably prefer to use the .net Serializer but will consider other options if this wont work.

Upvotes: 4

Views: 860

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564801

Why not just use one of the many JSON parsers for C#.

Personally, I think Json.NET is very nice. It supports LINQ queries against JSON data, serialization to/from JSON, etc.

Upvotes: 5

Related Questions