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

Make EnumRepresentationConvention also affect collections of Enums

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Serialization
    • Fully Compatible

    Description

      As someone mentioned on SO (https://stackoverflow.com/questions/47313022/mongodb-c-sharp-driver-serializing-listenum-as-string), the following cases are currently not handled by the EnumRepresentationConvention:

      List<EnumType> { get; set; }
      List<List<List<EnumType>>> { get; set; }
      Dictionary<EnumType, OtherType> { get; set; }
      Dictionary<OtherType, EnumType> { get; set; }
      

      The convention currently only works on straight Enums as in

      EnumType E { get; set; }
      

      and nullable Enums as in:

      EnumType? E { get; set; }
      

      This improvement is about making sure that (even nested) collections of the various kinds are affected by the convention as expected.

      Attachments

        Activity

          People

            Unassigned Unassigned
            daniel.hegener@gmx.net Daniel Hegener
            Votes:
            6 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated: