title: Using EF Core ThenInclude() on Junction tables
body: <p>I'm transfering my .NET Framework (EF6) code to ASP.NET Core (EF Core), and I stumbled upon this issue. Here is some example code:</p>
  
  <p>In EF6 I use Include() and Select() for eager-loading:</p>
  
  <pre><code>return _context.Post
  .Include(p =&gt; p.PostAuthor.Select(pa =&gt; pa.Author).Select(a =&gt; a.Interests))
  </code></pre>
  
  <p>PostAuthor is a junction table and there is also a Junction table "AuthorInterest" which I didn't need to involve in EF6 (Select goes straight to a.Interests).</p>
  
  <p>Anyway, I can see that in EF7 this is reworked, meaning that I should use ThenInclude() for nested queries now. However...</p>
  
  <pre><code>return _context.Post
    .Include(p =&gt; p.PostAuthor)
      .ThenInclude(pa =&gt; pa.Select(pa2 =&gt; pa2.Author))
  ...etc
  </code></pre>
  
  <p>The above code fails because of the Select() statement. The documentation on <a href="https://docs.efproject.net/en/latest/querying/related-data.html" rel="noreferrer">https://docs.efproject.net/en/latest/querying/related-data.html</a> seems to suggest that I don't need it and I can access Author immediately, but I get an ICollection in the last lambda displayed, so I obviously need the Select(). I go through multiple junction tables further on in the query, but for simplicity's sake, let's just focus on the first one.</p>
  
  <p>How do I make this work?</p>