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

Make EnumRepresentationConvention also affect collections of Enums

    • Fully Compatible
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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.

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

              Created:
              Updated: