-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
I have Enum:
{{}}
public enum SomeType { TypeA, TypeB, TypeC }
{{}}
but in MongoDB i would like this map to: type_a type_b type_c
I'm using EnumRepresentationConvention(BsonType.String)
I tried:
{{}}
public enum SomeType { [BsonElement("type_a")] TypeA, [BsonElement("type_b")] TypeB, [BsonElement("type_c")] TypeC }
{{}}
but this doesn't work. Im getting exception:
Requested value 'type_a' was not found.
Is anyone know how can achieve such mapping in MongoDb C# driver?