【发布时间】:2018-11-02 04:28:20
【问题描述】:
所以,我做了这样的课程:
public class Values
{
public string odata_context { get; set; }
public List<ContactsDeserialize> keyValues { get; set; }
}
public class ContactsDeserialize : IDisposable
{
public string odata_etag { get; set; }
public Guid contactid { get; set; }
public string crimson_title { get; set; }
public string firstname { get; set; }
public string lastname { get; set; }
public DateTime? createdon { get; set; }
public DateTime? birthdate { get; set; }
public string emailaddress1 { get; set; }
public string mobilephone { get; set; }
public string address1_line1 { get; set; }
public string address1_line2 { get; set; }
public string address1_line3 { get; set; }
public string address1_city { get; set; }
public string address1_postalcode { get; set; }
public string address1_telephone1 { get; set; }
}
但是当我尝试反序列化时 这通过使用
Values ContactData = JsonConvert.DeserializeObject<Values>(jsonstring);
它返回空值。 查不出原因
谢谢
【问题讨论】:
-
Json 格式是否正确?我遇到过几次,根据返回结果的方式,对象可能不会用逗号分隔,这会破坏反序列化。
标签: c# asp.net .net dynamic crm