假设我们有一个像这样的类:
using System;
using System.Xml.Serialization;
namespace XmlEntities {
[XmlRoot("Agent")]
public class RootClass {
private string element_description;
[XmlElement("Name")]
public string Name{ get; set; }
}
[XmlElement("Surname")]
public string Surname{ get; set; }
}
}
而且我们只想序列化成xml Name
XmlElement。如何在序列化时限制它?