Deserializing nullable datetime?

Oct 6, 2011 at 1:42 PM

I get an error when trying to deserialize a json into an object, specifically a nullable datetime? member.

Cannot deserialize JSON object into type 'System.Nullable`1[System.DateTime]'.

{
  "Id":1000,
  "DateOfBirth":{
    "nil":"true"
  },
  "Title":"OTHER",
  "FamilyName":"Banks",
  "GivenName":"John"
}

Contact member declared as

public DateTime? DateOfBirth {get;set;}

JSONNet.Deserialize<Contact

>(json) 

 

Any help would be appreciated.