-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: BSON
-
Environment:C#
The driver supports BsonIgnoreIfNull and BsonIgnoreIfDefault which of course simply skip serializing properties based on their value.
For Collection properties (List, hashset, dictionary, etc.) it would be great to have a [BsonIgnoreIfEmpty] property that would skip serialization on both null or if the collection was empty.