2
I have an entity called Team (image 1) which in turn has a Icollection of Userteam (image 2) which in turn has a Icollection Applicationuser called Member.
Goal: return a list of Teams with their Members
Restriction: I cannot change the structure of the entities.
Parlance: c-Sharp
Framework: dotnet Core 2.0
var query = _context.Team.AsQueryable().AsNoTracking()
.Include(x => x.Account)
.Include(x => x.UserTeam)
.Where(x => x.Id == teamId && x.Deleted == false);
What is the problem? Ps.: avoid using images and present your code as text in the question. It is always important to have a [MCVE]
– Leandro Angelo
Leandro Angelo, just read the goal to understand. The important code was written in the question. Are you sure you read every question ?
– Carlos Henrique
It would not put a . Tolist() after the Where ?
– Fabri Damazio
No. We usually use Include to do "Join" but when there is more than one level (Userteam Include and Member Include in Userteam), I don’t know how to solve.
– Carlos Henrique
@Carlinhos, no, the images are blocked here, so it is important to include the code as text
– Leandro Angelo
@Leandroangelo block stackoverflow is slutty heim ? rs
– Carlos Henrique
The images are not hosted in the stack overflow and it is common to block them. To avoid interventions, negative votes and deletions always try to add the codes as text and properly formatted.
– tvdias