title: Deserialize multiple JSON records in C#
body: <p>I have the following string of Json records:</p>
  
  <pre><code>{
     "records":[
        {
           "PK":"1_1_8",
           "ID":"8",
           "DeviceID":"1",
           "RootID":"1",
           "CustName":"test1",
           "CustSurname":"test2",
           "Address":"Nisou 1",
           "City":"",
           "ZipCode":"",
           "PhoneNumber":"45646",
           "HomePhoneNumber":"",
           "Email":"",
           "Notes":"",
           "Owner":"1",
           "LanguageID":"1",
           "LanguagePK":"",
           "DeletedFlag":"false",
           "created":"2017-10-25 10:15:00",
           "modified":"2017-10-25 09:35:43"
        },
        {
           "PK":"1_1_33",
           "ID":"33",
           "DeviceID":"1",
           "RootID":"1",
           "CustName":"",
           "CustSurname":"",
           "Address":"",
           "City":"",
           "ZipCode":"",
           "PhoneNumber":"",
           "HomePhoneNumber":"",
           "Email":"",
           "Notes":"",
           "Owner":null,
           "LanguageID":"0",
           "LanguagePK":"",
           "DeletedFlag":"true",
           "created":"2017-10-25 10:13:54",
           "modified":"2017-10-25 10:13:54"
        },
        {
           "PK":"1_1_16",
           "ID":"16",
           "DeviceID":"1",
           "RootID":"1",
           "CustName":"Theodosis",
           "CustSurname":"",
           "Address":"Dali",
           "City":"Nicosia",
           "ZipCode":"2540",
           "PhoneNumber":"45645",
           "HomePhoneNumber":"99123456",
           "Email":"theodosis@gmail.com",
           "Notes":"",
           "Owner":"",
           "LanguageID":"1",
           "LanguagePK":"",
           "DeletedFlag":"false",
           "created":"2017-10-25 09:36:22",
           "modified":"2017-10-25 09:36:22"
        }
     ]
  }
  </code></pre>
  
  <p>I am using Xamarin PCL in C# trying to parse this string into a list of objects.</p>
  
  <p>I have a <code>Customer</code> class:</p>
  
  <pre><code>public class Customer
  {
      [PrimaryKey]
      public string PK { get; set; }
      public int DeviceID { get; set; }
      public int ID { get; set; }
  
      public string RootID{ get; set; }
  
      public string CustName { get; set; }
      public string CustSurname { get; set; }
      public string Address { get; set; }
      public string City { get; set; }
      public string ZipCode { get; set; }
      public string PhoneNumber { get; set; }
      public string HomePhoneNumber { get; set; }
      public string Email { get; set; }
      public string Notes { get; set; }
      public bool Owner { get; set; }
  
      public int LanguageID { get; set; }
      public string LanguagePK { get; set; }
  
      public bool DeletedFlag { get; set; }
      public DateTime created { get; set; }
      public DateTime modified { get; set; }
  }
  </code></pre>
  
  <p>I also tried out having a container class with a list of <code>Customer</code> objects.</p>
  
  <pre><code>public class DataContainer
  {
      public List&lt;Customer&gt; customers { get; set; }
  }
  </code></pre>
  
  <p>I have seen quite a few of examples online on how to parse this into a list or any workable type but nothing seems to be working for me.</p>
  
  <p>I have tried the following (JsonResults holds the string of Json records):</p>
  
  <pre><code>var observation = JsonConvert.DeserializeObject&lt;DataContainer&gt;(JsonResults);
  </code></pre>
  
  <p>From other posts, I am not able to access <code>JavaScriptSerializer</code> class from my code, perhaps because of the Xamarin PCL Framework I am using.</p>
  
  <p>Any ideas would be very welcome, as I said I do not mind the format I parse the string into, as long as it's workable.</p>
  
  <p>Thank you.</p>