Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
-
None
Description
My Saves are not working. Mongo says I am trying to insert a document with a duplicate key. I think it's because my objects are serializing with key of "_id" instead of "Id". So I map this like this:
BsonClassMap.RegisterClassMap<Foo>(x => {
x.AutoMap();
var memberMap = x.GetMemberMap(c => c.Id)
.SetIdGenerator(CombGuidGenerator.Instance)
.SetRepresentation(BsonType.String);;
x.SetIdMember(memberMap);
x.IdMemberMap.SetElementName("Id");
});
By my documents still serialize with "_id".
Attachments
Issue Links
- duplicates
-
CSHARP-464 When Calling SetIdMember, ElementName Of Map Is Not Used
-
- Closed
-