Using C# MongoDB LINQ with discriminator describes exacty what I am trying to do, but I am trying to use the new official 2.0.1 driver.
I have a series of subclasses with their specialised properties all inheriting from a base class containing common properties. Discriminator attributes seem fine and I have successfully saved a mixture of documents using the subtypes.
What I expected to be able to do next was a query similar to:
var subsetB = db.GetCollection<BaseClass>("Documents").AsQueryable<BaseClass>().OfType<SubclassB>();
To get all the documents of type SubclassB. However, the AsQueryable() and OfType() methods mentioned in the documentation and articles I have found don't seem to be available.
Have I missed something or is there an alternative recommended method of achieving this with the new driver?