Parsing complicated Json Array in C# -


this question has answer here:

i have json array:

{  "array":[       {        "name_0":"value_0",        "name_1":"value_1"       },       {        "name_2":"value_2",        "name_3":"value_3",        "name_4":"value_4",        "name_5":"value_5"       }  ] } 

the data structures inside json array not consistent. how can parse them in c#? thanks!

one way be

var serializer = new javascriptserializer(); var data = serializer     .deserialize<dictionary<string, list<dictionary<string, string>>>>(input); 

this because json data structure this. innermost element have dictionary<string, string> nested in generic list in turn nested in generic dictionary.


Comments

Popular posts from this blog

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -