views:

12

answers:

0

Hello,

I've got the following scheme: (not really the code, just to get the idea)

class Person;
class Employee : Person;

class Company
{
    public Person ContactPerson { ...}
    public EntityReference<ContactPerson> ContactPersonReference {....}
}

Employee type got it's own table in the database (Table-per-Type inheritance).

Lets say I've got a Company instance without the ContacePerson loaded. How do I load the ContactPerson so it will load Employee fields as well (if needed)?

Is there a way to determine it on the select of all the companies as well?

Thanks