title: Include not working in LINQ query but works in LINQ Fluent API
body: <p><strong>The Problem</strong></p>
  
  <p>I have a LINQ query (against Entity Framework) that use <code>Include</code> to include some navigation properties.  One of those properties uses <code>ThenInclude</code> to include its own property collection.  When I run the query, the first level properties are included on the primary object but the sub-collection (the one using ThenInclude) is always empty.</p>
  
  <p>However, if I change the query to use Fluent API form, the query works and the sub-collection is actually included.  Why does this work for the Fluent form and not the normal LINQ query?</p>
  
  <p><strong>Example</strong></p>
  
  <pre><code>//FAIL - This returns Benefits but Benefits.Dates.Count = 0 on all Benefits
  var list1 = (from s in _context.Subscribers
                 .Include(s =&gt; s.Dates)
                 .Include(s =&gt; s.Benefits)
                 .ThenInclude(b =&gt; b.Dates)
                 where s.Id == 13643
                 select new { benefits = s.Benefits }).ToList();
  
  //SUCCESS - This returns Benefits and Benefits.Dates.Count is &gt; 0 on the ones with Dates
  var list2 = _context.Subscribers
                 .Include(s =&gt; s.Dates)
                 .Include(s =&gt; s.Benefits)
                 .ThenInclude(b =&gt; b.Dates)
                 .Where(s =&gt; s.Id == 13643)
                 .Select(s =&gt; new { benefits = s.Benefits}).ToList();
  </code></pre>
  
  <p>Am I mistaken that these queries should give the same output? </p>
  
  <p><strong>Update</strong></p>
  
  <p>I just tried manually linking things using LINQ and I am able to get Benefit dates included -- granted, its not apples to apples as the resulting set is different, but the point is that <code>Include(b =&gt; b.Dates)</code> seems to work in this case.  </p>
  
  <pre><code>var list3 = (from s in _context.Subscribers.Include(s =&gt; s.Dates)
               join b in _context.Benefits.Include(b =&gt; b.Dates) on s.Id equals b.SubscriberId
               select new {benefits = b}).ToList();
  </code></pre>
  
  <p>I'm beginning to wonder if <code>ThenInclude()</code> may be a little more restrictive in where/when it can be used?</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>I just noticed a warning in my Debug Output window that led me to <a href="https://docs.microsoft.com/en-us/ef/core/querying/related-data#ignored-includes" rel="nofollow noreferrer">this link about ignored includes</a>.  This seems to be on the right track as the Debug Output clearly indicates that these includes are being ignored.</p>
  
  <p>What doesn't make sense, though, is that I'm actually selecting to anonymous in both examples and only one of them seems to ignore the includes.  Why one and not the other?</p>