When you create a property path that goes from one DomainObject class to another, the re-linq to re-store bridge has to create a join between the tables associated with the DomainObject classes. In concrete-table inheritance scenarios, it can happen that the class involved in the path does not have a table associated with it because only its subclasses are mapped to tables. In such cases, re-store will throw an exception.
For example, the following test queries will cause this exception to happen:
var query = from c in QueryFactory.CreateLinqQuery<TableInheritance.TestDomain.ClassWithUnidirectionalRelation> () where c.DomainBase.CreatedAt == new DateTime (2006, 01, 03) select c;
var query = from c in QueryFactory.CreateLinqQuery<TableInheritance.TestDomain.Client> () from domainBase in c.AssignedObjects where domainBase.CreatedAt == new DateTime (2006, 01, 03) select domainBase;
To resolve this, re-store should use views instead of tables for the joins.
In Remotion.Data.DomainObjects.Queries:
In Remotion.Data.Linq: