I have an self-related table:
UnitID UnitParentID Name
Code to retrieve 1 level :
return contexto.unit
.Include("unit1")
Code to retrieve 2 levels :
return contexto.unit
.Include("unit1.unit1")
Code to retrieve 3 levels :
return contexto.unit
.Include("unit1.unit1.unit1")
How do I do this for many levels?
I have had that Problem these days and resolved it like this.
You have to load all entites first like:
After that you have to select these units you want to have like:
This works fine for me! Hope I could help you!
Best regards Julian