title: deserializing JSON object .net
body: <p>I have problem with deserialize json object. I read many threads on stackoverflow but I didn't find solution. I use .net 2.0 and Newtonsoft library.</p>
  
  <p>Below is json string:</p>
  
  <pre><code>{
      "data": {
          "custom_fields": [{
              "field": "segmentid",
              "value": "B"
          },
          {
              "field": "subsegmentid",
              "value": "TM3"
          },
          {
              "field": "contactpersonid",
              "value": "000187_003"
          },
          {
              "field": "firstname",
              "value": "ZBIGNIEW"
          },
          {
              "field": "agreetment",
              "value": "1"
          },
          {
              "field": "contactname",
              "value": "ZBIGNIEW TESTOWY"
          },
          {
              "field": "decisionmaking",
              "value": "0"
          },
          {
              "field": "lastpurchase",
              "value": ""
          },
          {
              "field": "agethresholds",
              "value": "0"
          },
          {
              "field": "tendercust",
              "value": ""
          }],
          "email": "myself@example.com",
          "state": "1"
      },
      "status": "OK"
  }
  </code></pre>
  
  <p>I developed two classes but I still get below error.</p>
  
  <blockquote>
    <p>Cannot deserialize the current JSON object (e.g. {\"name\":\"value\"})
    into type 'System.Collections.Generic.List`1[FMIntegration.DataFM]'
    because the type requires a JSON array (e.g. [1,2,3]) to deserialize
    correctly.\r\nTo 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.\r\nPath 'data.email'</p>
  </blockquote>
  
  <pre><code>var SubscriberGet = JsonConvert.DeserializeObject&lt;SubscriberGet&gt;(json); 
  
  public class SubscriberGet
  {
      [JsonProperty("status")]
      public string Status { get; set; }
  
      [JsonProperty("data")]
      public List&lt;DataFM&gt; Data { get; set; }
  }
  
  public class DataFM
  {
      [JsonProperty("email")]
      public string Email { get; set; }
  
      [JsonProperty("custom_fields")]
      public List&lt;String&gt; custom_fields { get; set; }
  
      [JsonProperty("state")]
      public string State { get; set; }
  }
  </code></pre>