title: Json.NET: Deserialization with list of objects
body: <p>I am processing JSON responses (displayed below) from a service on my Windows Phone 7 client. I am using Json.NET to deserialize them into an object, which contains List of products. </p>
  
  <p>But after I deserialize, when I looked into my serviceresponse object, I can see a list of 2 products. But when I expand the product object, the fields under product (Name, ExpiryDate... etc ) are all null.</p>
  
  <p>I guess my problem is with the way I have defined my serviceresponse class. Can someone help me to resolve the issue and get the correct output.</p>
  
  <p>My deserialization code:</p>
  
  <pre><code>serviceresponse deserializedProduct = JsonConvert.DeserializeObject&lt;serviceresponse&gt;(json);
  </code></pre>
  
  <p>My Json response String:</p>
  
  <pre><code>{ "serviceresponse" : 
  
  { "company" : "ford", "success" : "Yes", "products" : [
    {"product" : 
  
        {
          "Name": "Product 1",
          "ExpiryDate": "\/Date(978048000000)\/",
          "Price": "99.95",
          "Sizes": "1"
        }
    },
    {"product" : 
        {
          "Name": "Product 2",
          "ExpiryDate": "\/Date(1248998400000)\/",
          "Price": "12.50",
          "Sizes": "1"
        }
    }
  ], "callbackformore" : "No", "message" : "1" 
  
      } 
  }
  </code></pre>
  
  <p>My serviceresponse class:</p>
  
  <pre><code>[DataContract]
  public class serviceresponse
  {
      [DataMember]
      public String company;
      [DataMember]
      public String success;
      [DataMember]
      public List&lt;product&gt; products;
      [DataMember]
      public String callbackformore;
      [DataMember]
      public String message;
  }
  
  [DataContract]
  public class product
  {
      [DataMember]
      public String Name;
      [DataMember]
      public String ExpiryDate;
      [DataMember]
      public String Price;
      [DataMember]
      public String Sizes;
  }
  </code></pre>