from entity in MyContext.EntityType.Include("ChildEntitiesNavigationPropertyName")
select entity;
This returns all instances of EntityType, plus ChildEntitiesNavigationPropertyName when/if it exists. For tabular form use an anonymous type:
from entity in MyContext.EntityType.Include("ChildEntitiesNavigationPropertyName")
select new {ParentProperty = entity.ParentProperty,
ChildProperty = entity.ChildEntitiesNavigationPropertyName.ChildProperty};
For a 1..* property:
from entity in MyContext.EntityType.Include("ChildEntitiesNavigationPropertyName")
from child in entity.ChildEntitiesNavigationPropertyName.DefaultIfEmpty()
select new {ParentProperty = entity.ParentProperty,
ChildProperty = child.ChildProperty};
Craig Stuntz
2009-02-11 17:00:53