I have 3 tables:
Contract, matter and claims. Each table has a 1:N relationship with the following table.
I want to select claim name where contract con_name = 'C109K'
var claims = await _context.Claims.AsNoTracking()
.Include(cl=>cl.Matter)
.ThenInclude(mat=>mat.Contract)
.Where(con=>con.con_name=='C109K')
.Select(cl=>new{name=cl.cl_name})
The error is that the where clause is unable to find con_name because the context is claims.
I also tried the other way round - that is - starting the query from contract. But in that case the select is unable to get claim name since the query context is contract.
How can I correctly write this query?