-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: 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())