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

EnumRepresentationConvention does not apply to arrays

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 2.2.4, 2.3, 2.4.4
    • Fix Version/s: None
    • Labels:
      None

      Description

      Hello,

      my goal is to store all enum types as string in MongoDB instead of the default int storage.

      I'm using the following code:

      ConventionRegistry.Register("StringEnumConvention",
                              new ConventionPack {new EnumRepresentationConvention(BsonType.String)}, t => true);
      

      This code is executed before the first usage of MongoClient

      But looks like this setting is completely ignored. Any ideas?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rstam Robert Stam
              Reporter:
              dnauck Daniel Nauck
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: