-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.3.1
-
Component/s: None
-
None
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.
- is related to
-
CSHARP-400 Improve error message in SetIdMember when memberMap argument is for a different class
- Closed