Assume the following hierarchy:
class Department { EntityCollection<Employee> Employees; } class Employee { string Name; } class RemoteEmployee : Employee { Country Location; EntityReference<Country> CountryReference; } So, department contains a list of employees. There is a hierarchy of employee types, some types reference other entities. Let's suppose we need to load department with its employees. OK, not a problem:
dataContext.Departments.Include("Employees") This returns concrete employee types (i.e. RemoteEmployee for Remote ones). Now we need to load Location with Remote employees.
dataContext.Departments.Include("Employees").Include("Employees.Location") - Error: no such property in Employee dataContext.Departments.Include("Employees").Include("RemoteEmployees.Location") - Error: no such property in Department What should I specify in Include to load Location with RemoteEmployee?