title: Entity Framework QueryFilter not applied to related entities
body: <p>I have set up QueryFilters on all my tables to ignore any entity where <code>DeletedDate != null</code>.</p>
  <pre><code>modelBuilder.Entity&lt;DbEntity&gt;().HasQueryFilter(c =&gt; c.DeletedDate == null);
  </code></pre>
  <p>This works great for all entities accessed directly through the context.</p>
  <p>The below code will return <code>null</code> given that the tag has <code>DeletedDate</code> set to a non null value.</p>
  <pre><code>var tagWillBeNull = _context.Tags.FirstOrDefault(t =&gt; t.Id == deletedUserTagId);
  </code></pre>
  <p>However. In the below code the deleted tag will be returned (given that it is related to the user).</p>
  <pre><code>var tagWillBeReturned = _context.Users
                                  .FirstOrDefault(u =&gt; u.Id == user.Id)
                                  .Tags.Where(t =&gt; t.Id == deletedUserTagId);
  </code></pre>
  <p>Is there any way to apply query filters to these related entities as well?</p>
  <p>I don't want to have to remember to write <code>.Where(e =&gt; e.DeletedDate == null)</code> on all related entity queries.</p>
  <p><strong>EDIT #1</strong>: this test fails on the last assert:</p>
  <pre><code>public void SoftDeletedTagNotReturnedForUser()
  {
      // setup
      List&lt;User&gt; generatedUsers = SetupDatabaseUsersContent();
  
      // act
      var user = _context.Users.FirstOrDefault();
  
      var deletedUserTag = user.Tags.FirstOrDefault();
  
      _context.Tags.Remove(deletedUserTag);
      _context.SaveChanges();
      _context.ChangeTracker.Clear() // added this from comment. Removes problem.
  
      var tagWillBeNull = _context.Tags.FirstOrDefault(t =&gt; t.Id == deletedUserTag.Id);
      var allTagsForUserShouldNotHaveSoftDeleted = _context.Users.FirstOrDefault(u =&gt; u.Id == user.Id).Tags.ToList();
      
      // assert
      Assert.Null(tagWillBeNull); // this is OK
  
      foreach(var tag in allTagsForUserShouldNotHaveSoftDeleted)
          Assert.Null(tag.DeletedDate); // this fails
  }
  </code></pre>
  <p><strong>EDIT #2:</strong> This did not work.</p>
  <pre><code>public override int SaveChanges()
  {
      PerformPreSaveProcessing();
      var result = base.SaveChanges();
  
      this.ChangeTracker.Clear();
      return result;
  }
  </code></pre>