Hi,
I am trying to do a parent/child join on the same entity (same SQL table) in this format:
EntityType1[] = DataContext.EntityType1.Join(
EntityParent => EntityParent.ID,
EntityChild => EntityChild.ParentID,
(EntityParent, EntityChild) => new { EntityParent, EntityChild }
).Select(obj => obj.EntityChild).ToArray();
Obviously this is pseudo and I have a reason for doing the join in my where clause, I am having a problem where the query generated appears to come out with the parent object on both sides of this join, see below:
SELECT EntityChild.* FROM EntityType1 EntityParent, EntityType1 EntityChild WHERE EntityParent.ID = EntityParent.ParentID
Is there some syntax I have missed to alias the second instance of the Entity Type or is this a problem with the query generation?
Thanks,
Carl