title: EF Core Query Many to Many with filtering
body: <p>I have the following table structure:</p>
  
  <p><a href="https://i.stack.imgur.com/yKTJF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yKTJF.png" alt="enter image description here"></a></p>
  
  <p>I want to retrieve all funds for provided <strong>reportId</strong>.
  I did it this way:</p>
  
  <pre><code>                var result = _context.FundsInReports
                          .Join(_context.Funds,
                                  a=&gt; a.FundId,
                                  b =&gt; b.Id,
                                  (fir, fund) =&gt; new {fir, fund})
                          .Join(_context.Reports,
                                  a=&gt; a.fir.ReportId,
                                  b=&gt; b.Id,
                                  (fir2, report) =&gt; new { fir2, report})
                          .Where(q=&gt; q.fir2.fir.ReportId==reportId)
                          .Select(res =&gt; new FundsResponse()
                          {
                              FundId = res.fir2.fund.Id,
                              LegalName = res.fir2.fund.LegalName,
                              HeaderName = res.fir2.fund.HeaderName,
                              PortfolioCurrency = res.fir2.fund.PortfolioCurrencyId,
                              BaseCurrency = res.fir2.fund.BaseCurrencyId,
                              FileName = res.fir2.fund.FileName,
                              Locked = res.fir2.fund.Locked
  
                          }).ToList();
  </code></pre>
  
  <p>and this works fine...
  However, I would like to use this code:</p>
  
  <pre><code>                var result = _context.Funds
                      .Include(a =&gt; a.FundsInReports)
                      .ThenInclude(a =&gt; a.Report)         // Many to many , intellisense is not working here !
                      .Select(res =&gt; new FundsResponse()
                      {
                          FundId = res.Id,
                          LegalName = res.LegalName,
                          HeaderName = res.HeaderName,
                          PortfolioCurrency = res.PortfolioCurrencyId,
                          BaseCurrency = res.BaseCurrencyId,
                          FileName = res.FileName,
                          Locked = res.Locked
  
                      }).ToList();
  </code></pre>
  
  <p>but I don't know how to add filtering (where) into this code.
  Thanks...</p>