How do I get a deeply-nested property from JSON string?
<p>How can I get the "myThings" array out of JSON that looks like the following using JSON.NET?</p>

<p>Example 1:</p>

<pre><code>{
    "z": {
        "a": 1,
        "b": 2
    },
    "something": {
        "y": [1, 2],
        "somethingElse": {
            "1234": {
                "foo": "bar",
                "myThings": [{
                    "name": "bob",
                    "age": 3
                }, {
                    "name": "bob",
                    "age": 3
                }]
            }
        }
    }
}
</code></pre>

<p>Example 2:</p>

<pre><code>{
    "z": {
        "a": 1,
        "b": 2
    },
    "something": {
        "y": [1, 2],
        "somethingElse": {
            "7890": {
                "foo": "bar"
            }
        }
    }
}
</code></pre>

<p>A couple things that I'm having difficulties with:</p>

<ul>
<li>One of the property names is a number that is unpredictable ("1234" and "7890")</li>
<li>Sometimes the "myThings" array doesn't exist - in this case null or an empty array/collection is what I want to have</li>
</ul>

<p>Another consideration in case it helps you: I do have a static class that represents the things inside of the myThings array, so my ideal return value would be <code>IEnumerable&lt;MyThing&gt;</code></p>

<p>My first attempt was to use <code>JsonConvert.DeserializeObject&lt;dynamic&gt;(json)</code> but I don't know how to handle the issues I mentioned above. In the end, I don't need the entire JSON string's worth of data, just that inside array named "myThings".</p>