title: Deserializing JSON array into strongly typed .NET object
body: <p>When I can call the 3rd party api and get back a single class worth of data everything deserialises fine using this code </p>
  
  <pre><code>TheUser me = jsonSerializer.Deserialize(response, typeof(TheUser)) as TheUser
  </code></pre>
  
  <p>The problem comes when I try and deserialise JSON response content that is an array, such as </p>
  
  <pre><code>{
     "data": [
        {
           "name": "A Jones",
           "id": "500015763"
        },
        {
           "name": "B Smith",
           "id": "504986213"
        },
        {
           "name": "C Brown",
           "id": "509034361"
        }
     ]
  }
  </code></pre>
  
  <p>I can only get the serialization to work if I use a custom wrapping class around the "data" member and that member needs to be of type <code>List&lt;object&gt;</code>. If it have them as type <code>List&lt;TheUser&gt;</code> I get <code>ArgumentException</code> from the <code>JsonParser DesializeType</code> method.</p>
  
  <p>I originally tried to serialise without a wrapping type like this</p>
  
  <pre><code>List&lt;TheUser&gt; freinds = jsonSerializer.Deserialize(response, typeof(List&lt;TheUser&gt;)) as List&lt;TheUser&gt;;
  </code></pre>
  
  <p>but that just returns me an empty collection. Surely I must be able to have the array deserialize to a strongly typed list.</p>