I have a complex inheritance structure in my data model. A majority of classes in my model (which is designed in VS 2010 with a DB generated by it after) are derived from 3 basic classes. And only these 3 classes can be found among the context members. How do I use all the derived classes at all?
Share
You can query for subtypes like this:
This will fetch all Horse objects from the Animal set in my examle context.
If you wish to query on sub type specific properties you can do:
This will all be translated to SQL, so there is no overhead like fetching all animals and filtering on client side, it works as it should.
HTH