Details
-
Bug
-
Resolution: Done
-
Major - P3
-
1.3.1
-
None
-
None
Description
This code from the docs:
BsonClassMap.RegisterClassMap<MyClass>(cm => {
|
cm.AutoMap();
|
cm.SetIdMember(cm.GetMemberMap(c => c.SomeProperty));
|
});
|
...fails if SomeProperty is on a base of MyClass.
Based on another issues I read (CSHARP-396) I thought this might work:
BsonClassMap.RegisterClassMap<BaseOfMyClass>(cm => {
|
cm.SetIdMember(x.GetMemberMap(c => c.SomeProperty));
|
});
|
But that fails too. Both cases fail with cryptic message "Invalid memberMap."
The only workaround for mapping via code seems to be remove inheritance.
Attachments
Issue Links
- is related to
-
CSHARP-400 Improve error message in SetIdMember when memberMap argument is for a different class
-
- Closed
-