Deserialize array of JSON objects to c# anonymous -


this question has answer here:

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

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -