Hi,
I have a table with a 1..N relationship with herself. When I do a GetAllIncluding, it only gives me a one level of depth (ruleRepository.GetAllIncluding(x => x.Childs)), when the Childs has another Childs (4 levels of deep, relations). How can I do to give me all levels of depth?
Best Regards and thank you very much Toni
4 Answer(s)
-
0
- What is your product version?
- What is product framework type (.net framework or .net core)?
If you are using EF Core. You can use IQueryable's Include and ThenInclude
see https://docs.microsoft.com/en-us/ef/core/querying/related-data
-
0
Hi,
.net core + Angular version 4.9
This table contain one-to-many relation with herself. Each record contain a ParentId and List of Childs
I don't need Include and ThenInclude, I need in the same table, one register contain a child, this child have a parent and other child in the same time, this child contain a parent and child...
when make -> var query = ruleRepository.GetAllIncluding(x => x.Childs, x => x.ListRuleValidators); Only one level of depth returns
I hope that parent returns with his children and his children with his children... but those children (have other children) do not show them.
Regards
-
0
hi SASIMEXICO
Can you use Zero's Demo project to reproduce your situation and share it with me? [email protected] This way I can debug it locally.
Or you can share your entity and configuration code so that I can reproduce it.
-
0
This issue is closed because it has not had recent activity for a long time.