Let's say I have DB Tables like that:
Continent -> Countries -> Cities
-> Lakes
Now i want to include them
_db.Continents
.Include(p => p.Countries)
.ThenInclude(c => c.Cities)
.Include(p => p.Countries)
.ThenInclude(p => p.Lakes)
Is this the only way (by including countries twice) or is there another way?
There is actually support for this as of EF Core 2.1. The pattern looks something like this:
_db.Continents.Include(p => p.Countries).ThenInclude(c => c.Cities).ThenInclude((Country p) => p.Lakes)