title: Entity Framework Core always returns an empty list related tables
body: <p>I'm using .Net Core 5.0 and Entity Framework and I'm having issues with .Include(), it's returning empty lists.</p>
  <p>Here are the classes :</p>
  <pre><code>public class Contact
  {
      public int Id { get; set; }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public string FullName { get; set; }
      public string Address { get; set; }
      public string Email { get; set; }
      public string MobilePhoneNumber { get; set; }
  
      public ICollection&lt;ContactSkill&gt; ContactSkills { get; set; }
  }
  
  public class Skill
  {
      public int Id { get; set; }
      public string Name { get; set; }
      public int ExpertiseLevel { get; set; }
  
      public ICollection&lt;ContactSkill&gt; ContactSkills { get; set; }
  }
  
  public class ContactSkill
  {
      public int Id { get; set; }
      public int ContactId { get; set; }
      public int SkillId { get; set; }
  
      public Contact Contact { get; set; }
      public Skill Skill { get; set; }
  }
  </code></pre>
  <p>And the DbContext :</p>
  <pre><code>public class APIContext : DbContext
  {
      public APIContext(DbContextOptions&lt;APIContext&gt; options) : base(options)
      {
      }
  
      public DbSet&lt;Contact&gt; Contacts { get; set; }
      public DbSet&lt;Skill&gt; Skills { get; set; }
      public DbSet&lt;ContactSkill&gt; ContactSkills { get; set; }
  
      protected override void OnModelCreating(ModelBuilder modelBuilder)
      {
          modelBuilder.Entity&lt;Contact&gt;().ToTable(&quot;Contacts&quot;);
          modelBuilder.Entity&lt;Skill&gt;().ToTable(&quot;Skills&quot;);
          modelBuilder.Entity&lt;ContactSkill&gt;().ToTable(&quot;ContactSkills&quot;);
      }
  }
  </code></pre>
  <p>Both Contacts and Skills are filled properly but when I add the include, it's empty :</p>
  <pre><code>        var contact = await _context.Contacts
              .Include(c =&gt; c.ContactSkills)
                  .ThenInclude(cs =&gt; cs.Skill)
              .AsNoTracking()
              .FirstOrDefaultAsync(m =&gt; m.Id == id);
  </code></pre>
  <p>DbInitializer.cs :</p>
  <pre><code>    public static void Initialize(APIContext context)
      {
          context.Database.EnsureCreated();
  
          // Look for any contacts.
          if (context.Contacts.Any())
          {
              return;   // DB has been seeded
          }
  
          var contacts = new Contact[]
          {,
          new Contact{ FirstName = &quot;Sam&quot;, LastName = &quot;Gamegi&quot;, FullName = &quot;Sam Gamegi&quot;, Address = &quot;The Shire&quot;, Email = &quot;frodon.baggins@shire.middleearth&quot;, MobilePhoneNumber = &quot;+11 0 98 76 54 32&quot;  },
              new Contact{ FirstName = &quot;Samus&quot;, LastName = &quot;Samus Aran&quot;, FullName = &quot;Samus Aran&quot;, Address = &quot;Space&quot;, Email = &quot;samus.aran@metroid.com&quot;, MobilePhoneNumber = &quot;+66 1 23 45 76 90&quot;  },
          new Contact{ FirstName = &quot;Frodon&quot;, LastName = &quot;Baggins&quot;, FullName = &quot;Frodon Baggins&quot;, Address = &quot;The Shire&quot;, Email = &quot;frodon.baggins@shire.middleearth&quot;, MobilePhoneNumber = &quot;+11 0 98 76 54 32&quot;  },
          };
  
          // Look for any skills.
          if (context.Skills.Any())
          {
              return;   // DB has been seeded
          }
  
          var skills = new Skill[]
          {
              new Skill{ Name = &quot;.Net Framework&quot;, ExpertiseLevel = 75},
              new Skill{ Name = &quot;SQL&quot;, ExpertiseLevel = 80},
              new Skill{ Name = &quot;Bounty Hunter&quot;, ExpertiseLevel = 100},
              new Skill{ Name = &quot;Ring Bearer&quot;, ExpertiseLevel = 100}
          };
  
          foreach (var s in skills)
          {
              context.Skills.Add(s);
          }
          context.SaveChanges();
  
          // Look for any contact's skills.
          if (context.ContactSkills.Any())
          {
              return;   // DB has been seeded
          }
  
          var contactSkills = new ContactSkill[]
          {
              new ContactSkill{ ContactId = 1, SkillId = 1},
              new ContactSkill{ ContactId = 1, SkillId = 2},
              new ContactSkill{ ContactId = 2, SkillId = 3},
              new ContactSkill{ ContactId = 3, SkillId = 4},
          };
  
          foreach (var cs in contactSkills)
          {
              context.ContactSkills.Add(cs);
          }
          context.SaveChanges();
      }
  </code></pre>
  <p>I suppose my db is created because I see the data but I don't see my db in SQL Explorer.</p>