I have several classes that I serialize/deserialize, each with a number of properties, some of which I’d like dynamically use the “Xml.Serialization.XmlIgnore” attribute on. The idea being if I want to save specific property info, I manage it by setting/clearing a flag. Is that even possible?
I have several classes that I serialize/deserialize, each with a number of properties, some
Share
Yes, this is possible by using the XmlAttributesOverrides class. It lets you generate the attributes dynamically rather than specifying them in your source code. The MSDN Library article for the class has a good example.