最佳答案
在将 xml 文件序列化到.net c # 对象之后,我在返回的 json 中获得了 k _ BackingField。
I've added the DataContract and the DataMember attribute to the .net c# object but then I get nothing on the json, client end.
[XmlRoot("person")]
[Serializable]
public class LinkedIn
{
[XmlElement("id")]
public string ID { get; set; }
[XmlElement("industry")]
public string Industry { get; set; }
[XmlElement("first-name")]
public string FirstName { get; set; }
[XmlElement("last-name")]
public string LastName { get; set; }
[XmlElement("headline")]
}
返回的 json 示例:
home: Object
<FirstName>k__BackingField: "Storefront"
<LastName>k__BackingField: "Doors"