Entity Framework Code First - objects all inherit base class, how to exclude records with a disabled property
<p>I have a bunch of DTO objects that all inherit from a DtoBase class with some properties like Id, CreatedDate, and Disabled.</p>

<pre><code>public class MyAppContext : ApplicationDbContext
{
    public DbSet&lt;A&gt; As { get; set; }
    public DbSet&lt;B&gt; Bs { get; set; }
}

public class A : Base
{
    public bool LikesMilk { get; set; }
}

public class B : Base
{
    public string Name { get; set; }
}

public class Base
{
    public int Id { get; set; }
    public bool Disabled { get; set; }
}
</code></pre>

<p>When it comes time to querying the DB, is there an extension method or something I could write in order to exclude all disabled records on all queries for all objects?</p>

<pre><code>//both should exclude disabled records
db.As.FirstOrDefault(x =&gt; x.LikesMilk)
db.Bs.ToList()
</code></pre>