Dictionary with multiple types

I’m struggling to get my head around being able to declare an dictionary that has the structure below.

The top level would be Dictionary<string, ArrayList> but how do I declare the dictionary within the array that itself has an array?

{
“ParentArray”:[
{
“a key”:“any text”,
“another key”:“any text”,
“yet another key”:“any text”,
“ChildArray”:[
{
“a key”:“any text”,
“another key”:“any text”
}
]
}
]
}

Don’t use ArrayList (or any untyped collection for that matter).

Declare a custom data class that has everything you need.

public class SomeClass
{
    Dictionary<string, string> childArray;
}

Dictionary<string, SomeClass> parentArray;
1 Like

The saying can’t see the wood for the trees comes to mind!!! Thanks man :slight_smile: