【发布时间】:2011-05-27 07:07:21
【问题描述】:
我想创建一个用于序列化和反序列化的类。序列化时属性名应为“MyNameRequestType”,反序列化时应为“MyNameResponseType”。
问题是我应该如何创建或覆盖 XmlRootAttribute?
例如。
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlRootAttribute("MyNameRequestType", IsNullable = false)]
public class MyClass
{
public string MyProperty { get; set; }
}
【问题讨论】:
标签: c# xml serialization deserialization