title: How to parse JSON using RestSharp?
body: <pre><code>var client = new RestClient("http://10.0.2.2:50670/api");
  
  var request = new RestRequest("Inventory", Method.GET);
  
  request.OnBeforeDeserialization = resp =&gt; { resp.ContentType = "application/json"; };
  
  // execute the request to return a list of InventoryItem
  RestResponse&lt;JavaList&lt;InventoryItem&gt;&gt; response = (RestResponse&lt;JavaList&lt;InventoryItem&gt;&gt;)client.Execute&lt;JavaList&lt;InventoryItem&gt;&gt;(request);
  </code></pre>
  
  <p>The content returned is a JSON string, an array of objects. The following is a short excerpt of it:</p>
  
  <pre><code>[{"Id":1,"Upc":"1234567890","Quantity":100,"Created":"2012-01-01T00:00:00","Category":"Tequila","TransactionType":"Audit","MetaData":"PATRON 750ML"},{"Id":2,"Upc":"2345678901","Quantity":110,"Created":"2012-01-01T00:00:00","Category":"Whiskey","TransactionType":"Audit","MetaData":"JACK DANIELS 750ML"},{"Id":3,"Upc":"3456789012","Quantity":150,"Created":"2012-01-01T00:00:00","Category":"Vodka","TransactionType":"Audit","MetaData":"ABSOLUT 750ml"}]
  </code></pre>
  
  <p>The error message:</p>
  
  <blockquote>
    <p>Operation is not valid due to the current state of the object</p>
  </blockquote>
  
  <p>What is wrong here? My <code>InventoryItem</code> has the same properties as each object in the JSON string. Am I missing a step? </p>