我不太确定如何反序列化以下内容:
<property>
<price display="yes" plusSAV="no" tax="yes">1000000</price>
...
</property>
在我的C#模型中,我有一个Property对象,它包含一个Price属性,声明如下:
[XmlElement("price")]
public Price Price { get; set; }
然后在Price课程中,我有以下内容:
[Serializable]
public class Price : BaseDisplayAttribute, IDataModel
{
[XmlElement("price")]
public string PriceValueString { get; set; }
[XmlAttribute("plusSAV")]
public string PlusSAVString { get; set; }
[XmlAttribute("tax")]
public string TaxString { get; set; }
....
}
所有属性都正确反序列化,但price元素不是。我在这里说得对吗?
由于