title: Pass an Array with date and Deserialize it on ASP.Net MVC Controller
body: <p>I do countless research on my issue but non give me the answer i need.. Please kindly help me to fix my Deserialization on this array..</p>
  
  <p>Array data i am sending the controller:</p>
  
  <pre><code>$room_records_to_save.push({
     RoomId: anr_id,
     PaxAdult: anr_adult,
     PaxChild: anr_child,
     DateFrom: anr_dfrom,
     DateTo: anr_dto,
     Id: cnt
  });
  </code></pre>
  
  <p>Array it generates</p>
  
  <pre><code>{"RoomId":"5","PaxAdult":"2","PaxChild":"1","DateFrom":"03/20/2015","DateTo":"03/21/2015","Id":1},{"RoomId":"1","PaxAdult":"2","PaxChild":"1","DateFrom":"3/19/2015","DateTo":"3/19/2015","Id":2}
  </code></pre>
  
  <p>My Controller pattern:</p>
  
  <pre><code>public bool SaveReservationInq(string rooms) {
     List&lt;ReservationOnlineRoom&gt; rm = JsonHelper.Deserialise&lt;List&lt;ReservationOnlineRoom&gt;&gt;(rooms);
  
     foreach (var d in rm) {
        ReservationOnlineRoom.Create(d);
     }
  
     return true;
  }
  </code></pre>
  
  <p>here is my JsonHelper.cs class</p>
  
  <pre><code>public class JsonHelper {
     public static T Deserialise&lt;T&gt;(string json) {
        T obj = Activator.CreateInstance&lt;T&gt;();
        using (MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(json))) {
           DataContractJsonSerializer serializer = new DataContractJsonSerializer(obj.GetType());
           obj = (T)serializer.ReadObject(ms);
              return obj;
          }
      }
  }
  </code></pre>
  
  <p>here is the model ReservationOnlineRoom.cs</p>
  
  <pre><code>public class ReservationOnlineRoom {
      public int ReservationOnlineID { get; set; }
      public int RoomId { get; set; }
      public DateTime DateFrom { get; set; }
      public DateTime DateTo { get; set; }
      public int PaxAdult { get; set; }
      public int PaxChild { get; set; }
      public string Concern { get; set; }
  }
  </code></pre>
  
  <p>my problem is on deserialize the string room, and the error pops on JsonHelper.cs under the line</p>
  
  <pre><code>obj = (T)serializer.ReadObject(ms);
  </code></pre>
  
  <p>and the error it gives me is</p>
  
  <p>"There was an error deserializing the object of type System.Collections.Generic.List`1[[AMADA.Business.ReservationOnlineRoom, AMADA.Business, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]. DateTime content '2015-03-17T16:00:00.000Z' does not start with '/Date(' and end with ')/' as required for JSON."</p>
  
  <p>any help will be higly appreciated...</p>