Include Grandchildren in EF Query
Update: If you are using Entity Framework Core you should use the following syntax
var hierarchy = from p in ctx.Parents
.Include(p => p.Children)
.ThenInclude(c => c.GrandChild)
select p;
Sure, you can do
var hierarchy = from p in ctx.Parents
.Include(p => p.Children.Select(c => c.GrandChild))
select p;
See MSDN, caption Remarks, the fifth bullet.