C# Xml Deserialize plus design suggestions
问题 In my project I need to build a generic deserializer that should be backward compatible. Example: The XML looks like <PolicyDef name = "sample" type="type1"> <Options ......> </PolicyDef> The "type" is enum - PolicyTypes e.g public Enum PolicyTypes { type1 = 0, type2 = 1 } The PolicyDef class is defined as [XmlRoot("PolicyDef")] public class PolicyDef { private string policyName; private PolicyTypes policyType; public PolicyDefinition() { } [XmlAttribute] public string Name { get { return