[CSHARP-1465] Polymorphism documentation should mention how to call RegisterDiscriminatorConvention Created: 02/Nov/15  Updated: 12/Nov/20  Resolved: 12/Nov/20

Status: Closed
Project: C# Driver
Component/s: Documentation
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Robin Munn Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Neither http://mongodb.github.io/mongo-csharp-driver/2.1/reference/bson/mapping/polymorphism/ nor http://mongodb.github.io/mongo-csharp-driver/2.1/reference/bson/mapping/conventions/ mention the correct way to register a DiscriminatorConvention. This led me to try adding a ScalarDiscriminatorConvention to a ConventionPack, which doesn't work – and I had to [ask a question on Stack Overflow](http://stackoverflow.com/q/33432899/2314532) before I could figure out how to register a DiscriminatorConvention properly. (My database used a field called "type" rather than "_t", hence my need for a different discriminator convention.)

The reference documentation should probably be updated to mention this scenario, so that anyone else with similar needs will know how to do it in the future.


Generated at Wed Feb 07 21:39:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.