Details
-
New Feature
-
Resolution: Done
-
Minor - P4
-
1.0
-
None
Description
These methods would allow the decision whether a particular property should be serialized to be made at runtime. This is similar to [BsonIgnoreIfNull] but allows the developer to use custom criteria to decide whether to serialize the property or not. For example:
public class Employee {
// other fields
public string Zip;
public bool ShouldSerializeZip(string value)
{ return value != null && value != "' && value != "00000"; }}