EF Core Query Many to Many with filtering
问题 I have the following table structure: I want to retrieve all funds for provided reportId . I did it this way: var result = _context.FundsInReports .Join(_context.Funds, a=> a.FundId, b => b.Id, (fir, fund) => new {fir, fund}) .Join(_context.Reports, a=> a.fir.ReportId, b=> b.Id, (fir2, report) => new { fir2, report}) .Where(q=> q.fir2.fir.ReportId==reportId) .Select(res => new FundsResponse() { FundId = res.fir2.fund.Id, LegalName = res.fir2.fund.LegalName, HeaderName = res.fir2.fund