title: Iterate through an ExpandoObject that contains multiple ExpandoObjects
body: <p>I wondered if it is possible to iterate over an ExpandoObject that contains an array of Expando Objects?</p>
  
  <p>I am currently parsing some JSON with a file structure like the below:</p>
  
  <pre><code>"event": 
       [{
      "name": "BEGIN!",
      "count": 1
  }],
  "context": 
       {
       "customer": {
          "greetings": 
            [
             {  "Value1": "Hello" },
             {  "Value2": "Bye" }
            ],
          "nicknames": []
      }
  }
  </code></pre>
  
  <p>I can retrieve the expando object for 'event' by doing the following:</p>
  
  <pre><code>GenerateDictionary(((ExpandoObject[])dict["event"])[0], dict, "event_");
  </code></pre>
  
  <p>This is the code for the GenerateDictionary method:</p>
  
  <pre><code>private void GenerateDictionary(System.Dynamic.ExpandoObject output, Dictionary&lt;string, object&gt; dict, string parent)
      {
          try
          {
              foreach (var v in output)
              {
                  string key = parent + v.Key;
                  object o = v.Value;
  
                  if (o.GetType() == typeof(System.Dynamic.ExpandoObject))
                  {
                      GenerateDictionary((System.Dynamic.ExpandoObject)o, dict, key + "_");
                  }
                  else
                  {
                      if (!dict.ContainsKey(key))
                      {
                          dict.Add(key, o);
                      }
                  }
              }
          }
          catch (Exception ex)
          {
              WritetoLog(itemname, ex);
          }
      }
  </code></pre>
  
  <p>I am now totally stuck on how to retrieve all the values in 'context_customer_greetings' as when I attempt to do the below, it will only retrieve the object at context_customer_greetings_value1.</p>
  
  <pre><code>    GenerateDictionary(((System.Dynamic.ExpandoObject[])dict["context_customer_greetings"])[0], dict, "context_customer_greetings_");
  </code></pre>
  
  <p>Is it possible to iterate through an ExpandoObject?</p>
  
  <p>I hope this makes sense, thanking you in advance.</p>