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

EnumRepresentationConvention should apply to nullable enums

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.4.1
    • 2.0
    • Serialization
    • None

    Description

      The EnumRepresentationConvention does not currently apply to nullable enums.

      i.e. nullable enums are persisted using integer values even when the EnumRepresentationConvention is applied.

      EnumRepresentationConvention should apply to nullable enums.

      This is a slight backward breaking change in that the serialization format of nullable enums might change when using this convention. That won't be a problem for round tripping because the Deserialize method accepts either integers or strings, but must be taken into account if writing queries against the nullable enum field.

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            mattwhetton Matthew Whetton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: