Keeping Properties from getting serialized

In rare cases you might want to implement properties on your configuration objects that are not persisted into the configuration store. You should avoid this as much as possible but if you do need to do this you can use Serialization Attributes to keep the items from getting serialized:

If you would like to add a property that should not persist or be treated as a configuration properly define it with XmlIgnore and NonSerializable attributes:

[XmlIgnore]
[NonSerialized]
public string CurrentChapter { get; set; }

© West Wind Technologies, 2019 • Updated: 12/19/15
Comment or report problem with topic