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

Support `OfType` and `is` with scalar discriminators

    • Type: Icon: New Feature New Feature
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 3.0.0
    • Component/s: Linq, Serialization
    • None
    • Dotnet Drivers

      Currently `OfType` and `is` only work with the `HiearchicalDiscriminatorConvention`.

      This is because with hierarchical discriminators the `_t` value lists all of the classes in the class hierarchy, which makes it possible to write MQL queries for `OfType` and `is`.

      To support an `OfType` or `is` query in MQL requires a different query which lists all of the known subtypes in the query itself (rather than relying on them being stored in the `_t` field). This in turn requires that the `ScalarDiscriminatorConvention` implement the new `IScalarDiscriminatorConvention` interface ` and in particular the `GetDiscriminatorsForTypeAndSubTypes`  method.

            Assignee:
            Unassigned Unassigned
            Reporter:
            robert@mongodb.com Robert Stam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: