Reputation: 1200
I have a simple JSON array like this :
"{0: "4", 1: "5"}"
How can I deserialize this JSON array in ASP.NET MVC?
Upvotes: 0
Views: 4704
Reputation: 16636
Most ASP.NET MVC applications use the JSON.NET library for that purpose. In that case you would do:
var numbers = JsonConvert.DeserializeObject<List<string>>("{0: \"4\", 1: \"5\"}");
Upvotes: 2