【发布时间】:2008-11-26 20:05:42
【问题描述】:
我正在将我的类序列化为 XML,其中一个属性的类型为 List
public class MyClass {
...
public List<string> Properties { get; set; }
...
}
通过序列化此类创建的 XML 如下所示:
<MyClass>
...
<Properties>
<string>somethinghere</string>
<string>somethinghere</string>
</Properties>
...
</MyClass>
现在我的问题。我怎样才能改变我的类来实现这样的 XML:
<MyClass>
...
<Properties>
<Property>somethinghere</Property>
<Property>somethinghere</Property>
</Properties>
...
</MyClass>
序列化后。感谢您的帮助!
【问题讨论】:
标签: c# .net xml serialization