我有这个DataContract,这是一个字符串数组:
[System.Xml.Serialization.XmlArrayAttribute(Order = 19)]
[System.Xml.Serialization.XmlArrayItemAttribute("CardNumber", typeof(string), IsNullable = false)]
[DataMember]
public string[] Cards {get; set; }
因为我读,它应该被序列化这样的:
<Cards>
<CardNumber>123123</CardNumber>
</Cards>
但我仍然得到:
<Cards>
<string>123123</string>
</Cards>
它出什么问题了?