这是我的模型:
public class ReportAllMediaDetailsParams
{
public int profileID { get; set; }
public int organisationID { get; set; }
public DateTime startDate { get; set; }
public DateTime endDate { get; set; }
}
这是我的反序列化器:
var serializer = new JavaScriptSerializer();
var reportParams = serializer.Deserialize<ReportAllMediaDetailsParams>(json);
来自 json 的日期是:
"{\"profileID\":\"41\",\"organisationID\":\"2252\",\"startDate\":\"01/01/1970\",\"endDate\":\"01/01/1970\"}"