title: C# Iterate over a JSON object
body: <p>I'm trying to use the .Net Json deserializer <code>System.Text.Json</code> to iterate over the following Json input.</p>
  
  <p>I've found methods for iterating by "person_id" if it were the top level in the json structure (see below), but I haven't been able to track down a method for looping through all of the next level items. </p>
  
  <p>I think the NewtonSoft <code>JArray</code> and <code>JObject</code> are pretty close to what I need (I may pursue that) but wasn't sure if Microsofts solution had a way to do it...</p>
  
  <p>Is this possible with Microsoft's <code>System.Text.Json</code> library?</p>
  
  <pre><code>{
    "0": {
      "person_id": "0",
      "last_name": "Greg",
      "first_name": "Craig",
    },
    "1": {
      "person_id": "1",
      "last_name": "Doe",
      "first_name": "John",
    }
  }
  </code></pre>
  
  <p><code>JsonElement</code> solution for extracting an object by property name (ie I can get John Doe's information this way). </p>
  
  <pre><code>using (JsonDocument document = JsonDocument.Parse(jsonString))
  {
      JsonElement root = document.RootElement;
  
      JsonElement studentsElement = root.GetProperty("1");
  }
  </code></pre>