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;

Leave a Comment