Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2993

BsonIgnoreIfEmpty property attribute

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • BSON
    • None
    • C#

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            tarheit@watchtv.net Tim Arheit
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: