[CSHARP-1299] NamedIdMemberConvention should do nothing if base class already has an _id Created: 28/May/15 Updated: 05/Apr/19 Resolved: 21/Mar/17 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Serialization |
| Affects Version/s: | 1.10, 2.0 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Minor - P4 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Description |
|
Serializing the following classes fails because NamedIdMemberConvention doesn't realize that C already has an _id, and tries to map the Id in D to "_id" also, resulting in duplicate element names.
|
| Comments |
| Comment by Robert Stam [ 21/Mar/17 ] | |||||
|
The Id in the derived D class must have a different name. You could use the BsonElement attribute to tell the driver what name to use instead:
|