title: Filter all queries (trying to achieve soft delete)
body: <p>I am trying to get to work soft delete behaviour in EF Core 2.0.</p>
  
  <pre><code>public interface ISoftDeleteModel
  {
      bool IsDeleted { get; set; }
  }
  </code></pre>
  
  <p>Creating proper column and soft-deleting are working fine but filtering entities from DbContext isn't.</p>
  
  <p>I would like to use query filtering in context but I am stuck.</p>
  
  <pre><code>protected override void OnModelCreating(ModelBuilder modelBuilder)
  {
      Type entityType;
      // ^^^ it contains type of entity, eg. Blog, Post, etc. using
      // modelBuilder.Model.GetEntityTypes().First().Name and converting to Type
  
      var entity = modelBuilder.Entity(entityType);
      if(entityType.GetInterface("ISoftDeleteModel") != null)
      {
          // ??? how to access IsDeleted property ???
          entity.HasQueryFilter(x =&gt; !x.IsDeleted);
      }
  }
  </code></pre>
  
  <p>The question is simple - how to access IsDeleted property?</p>
  
  <p>If I knew type of the entity, eg. Post, and Post implemented ISoftDeleteModel I would be able to do this:</p>
  
  <pre><code>protected override void OnModelCreating(ModelBuilder modelBuilder)
  {
      modelBuilder.Entity&lt;Post&gt;().HasQueryFilter(x =&gt; !x.IsDeleted);
  }
  </code></pre>
  
  <p>But I do not know the type. I am trying to achieve simple thing - all models implementing this interface would be automatically filtered. Am I missing something?</p>