Parsing Enums as Strings is case-insensitive

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 2.13.2
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When enums are stored as string, they were parsed back case-sensitive until v2.12. Since that update, this behaviour was changed which causes issues when multiple enum values have different capitalizations.

      Example:

      public enum MyEnum {
          AnEnumValue,
          anenumvalue
      }

      In this example, Mongo will parse the string representation to the same Enum value.

      In my opinion, this behavior should at least be configurable.

      References in Code:

      - src/MongoDB.Bson/Serialization/Serializers/EnumSerializer.cs (in v2.12, the parsing logic has changed by adding a boolean parameter to Enum.Parse())

              Assignee:
              Dmitry Lukyanov (Inactive)
              Reporter:
              Raphael Guntersweiler
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: