Deserialize array of JSON objects to c# anonymous -
this question has answer here:
- deserialize json c# dynamic object? 21 answers
any ideas how achieve this? have no problem deserializing single json object c# anonymous type
string json = @"{'name':'mike'}"; to
var definition = new { name = ""}; with
var result = jsonconvert.deserializeanonymoustype(json, definition); but when have
string jsonarray = @"[{'name':'mike'}, {'name':'ben'}, {'name':'razvigor'}]"; i stuck. thanks!
you can deserialize dynamic object this.
dynamic result = jsonconvert.deserializeobject(jsonarray);
Comments
Post a Comment