DEV Community

Discussion on: Tree Structure in EF Core: How to configure a self-referencing table and use it.

Collapse
 
dr_dimaka profile image
Dmitry Pavlov

I really would love to have #IncludeRecursively in #EntityFrameworkCore instead.
Something like:
var folder = dbContext.Folders
.Include(x => x.Parent, recursively: true)
.Include(x => x.Children, recursively: true)
.ToList(); // or maybe even .ToTree() or lookup ;)