Poblems with a dictionary with not normalized index

Hello people,

I get a JSON with this structure:

{

"Anna": {

"name" : "Anna W",
"age":  23

},

"Andrew":{

"name" : "Andres G"
"age":  32

},
.
.
n

}

I transform it in a dictionary, but a I getting problems when I try to iterate it with a foreach, anyone knows another way to do it?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to andrew23co

    By definition you wouldn't be able to iterate over this, because it's not an array of a single dictionary, but rather a group of different dictionaries ("Anna" and "Andrew" are each separate items in the same parent dictionary, and each include their own unique dictionaries).  The fact that both of their dictionaries happen to contain the same data is coincidental and irrelevant to the fact that the structure is not set up to treat them as an array.

Children