title: Entity Framework 5 - only select entities where entity IsActive
body: <p>Using the Code First approach I have created a number of different entities that inherit from an interface <code>IConcurrent</code> with a property <code>IsActive</code> for example:</p>
  
  <pre><code>public class Currency : IConcurrent
  {
      public string CurrencyId { get; set; }
  
      public string Description { get; set; }
  
      public bool IsActive { get; set; }
  }
  </code></pre>
  
  <p>Each time I select entities I find myself always having to include a conditional clause such as this real basic example:</p>
  
  <pre><code>db.Currencies.Where(c =&gt; c.IsActive);
  </code></pre>
  
  <p>My question is that is it possible to some how intercept/hook into the <code>DbContext</code> so that my LINQ queries will always return <code>IsActive == true</code> for entities that inherit the IConcurrent interface, to avoid having to explicitly add <code>.Where(c =&gt; c.IsActive)</code> each time?</p>
  
  <p>So far I've looked at the possible methods to override in <code>DbContext</code> which none of them seem to fit the bill. Can anyone help?</p>