How should i mark properties, that they should not be serialize if they have default values? For example if i have boolean value it shoudl be serialized if is only set to true, the same with nullable value, if they are null i don’t want to include them in my serialization file.
Share
Ok I found it myself. It is
[DefaultValue(false)]. If I mark some property with this attr then it will be serialized only if is different than value in ().System.ComponentModel.DefaultValueAttribute