Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1465

Polymorphism documentation should mention how to call RegisterDiscriminatorConvention

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Do
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Documentation
    • None

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rmunn Robin Munn
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: