title: Deserializing an array of objects with Json.Net
body: <p>The received data is like this:</p>
  
  <p><img src="https://i.stack.imgur.com/nrnOt.png" alt="enter image description here"></p>
  
  <p>Inside each item, there is an object, <code>customer</code>, I have an identical class for that. How can I convert them using Json.net?</p>
  
  <p>I have tried the followings:</p>
  
  <pre><code>var data = JsonConvert.DeserializeObject&lt;List&lt;customer&gt;&gt;(val);
  </code></pre>
  
  <p>and adding another class:</p>
  
  <pre><code>public class customerJson
  {
      public Customer customer{ get; set; }
  }
  </code></pre>
  
  <p>And trying to deserialize it:</p>
  
  <pre><code>var data = JsonConvert.DeserializeObject&lt;List&lt;customerJson&gt;&gt;(val);
  </code></pre>
  
  <p>With both of them I get an exception:</p>
  
  <blockquote>
    <p>Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.Collections.Generic.List`1[customer]' because the type requires a JSON array (e.g. [1,2,3]) to deserialize correctly.
    To fix this error either change the JSON to a JSON array (e.g. [1,2,3]) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
    Path 'rows', line 1, position 8.</p>
  </blockquote>
  
  <p>Data:</p>
  
  <pre><code>{"rows":[{"id":"232333","name":"nam"},{"id":"3434444","name":"2ndName"}]}
  </code></pre>