0
我有這樣的模式:如何序列化到「收藏與屬性」使用XML序列
[XmlArray(ElementName = "Listing")]
[XmlArrayItem(ElementName = "Classification")]
public List<Classification> classifications { get; set; }
[XmlRoot("Listing")]
public class Classification
{
[XmlAttribute("Name")]
public string name { get; set; }
[XmlText]
public string Value { get; set; }
}
這給了我這樣的:
<Listing>
<Classification Name="Location">AsiaPacific</Classification>
</Listing>
我應該如何修改我的類來獲得這樣的:
<Listing reference = "MyReference">
<Classification Name="Location">AsiaPacific</Classification>
</Listing>