title: Extracting data from complex JSON structure in C#
body: <p>I have JSON data that looks like this:</p>
  
  <pre><code>{
     "position":[
        {
           "top":[
              42,
              12
           ]
        },
        {
           "middle":[
              10,
              15
           ]
        },
        {
           "bottom":[
              5,
              201
           ]
        },
        {
           "axis":[
              {
                 "X":[
                    901,
                    51,
                    67
                 ]
              },
              {
                 "Y":[
                    1474186,
                    561647
                 ]
              },
              {
                 "Z":[
                    911,
                    1296501
                 ]
              },
              15,
              20
           ]
        }
     ],
     "validated":true,
     "metadata":{
        "uri":"/data/complex/",
        "session":[
           1818,
           14
        ],
        "private":false
     },
     "vists":0,
     "ok":true,
     "data":{
        "10":{
           "title":"Alpha",
           "author":"Justin X. Ample",
           "cover":"/f48hf58.tiff"
        },
        "901":{
           "title":"Tau",
           "author":"Felina Blank",
           "cover":"/45trthrref.tiff"
        }
     },
     "live":null
  }
  </code></pre>
  
  <p>From this data I want to display a list like this:</p>
  
  <pre><code>Alpha, Justin X. Ample
  Tau, Felina Blank
  </code></pre>
  
  <p>Note that the keys (in my example, 10 and 901), are not predictable. So I want to somehow create an object that represents the "data" structure and iterate over it to get the title and author for each entry.</p>
  
  <p>With a basic JSON structure I had success with something like this (using JSON.NET):</p>
  
  <pre><code>public class Foo
      {
          public int bar { get; set; }
          public string baz { get; set; }
          public string quxx { get; set; }
      }
  
  ...
  
  // json = {"bar": 1, "baz":"two", "quxx":"three"}
  var result = await JsonConvert.DeserializeObjectAsync&lt;Foo&gt;(json);
  
  return result.baz // "two"
  </code></pre>
  
  <p>But I can't figure out what I need to do to make it work with a complex structure.</p>