Is there a way to get XmlSerialization in .NET to ignore certain properties while serializing?
For example, I have a public bool Property called IsValid and its the only Property of the object that I don't want serialized. How could I do this?
Is there a way to get XmlSerialization in .NET to ignore certain properties while serializing?
For example, I have a public bool Property called IsValid and its the only Property of the object that I don't want serialized. How could I do this?
Just apply [XmlIgnore] to the property you want to ignore.
See http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlattributes.xmlignore.aspx.