title: How to query all tables that implement an interface
body: <p>I have implemented an interface for some of my entity classes:</p>
  
  <pre><code>public partial class Order : IReportable
  {
     public string TableName { get { return "Order"; } }
  }
  
  public partial class Client: IReportable
  {
   public string TableName { get { return "Client"; } }
  }
  
  
  public interface IReportable
  {
      string TableName { get; }
  }
  </code></pre>
  
  <p>Then I added this to the DbContext:</p>
  
  <pre><code>public virtual DbSet&lt;IReportable&gt; IReportable { get; set; }
  </code></pre>
  
  <p>When I try to query all the tables that implement this interface (as shown here):</p>
  
  <pre><code>var result = from reportabletable in db.IReportable
               where reportabletable.TableName == table_name
              select reportabletable
  </code></pre>
  
  <p>I get the following exception:</p>
  
  <blockquote>
    <p><strong>The type 'Report.DataAccess.IReportable' was not mapped. Check that
    the type has not been explicitly excluded by using the Ignore method
    or NotMappedAttribute data annotation. Verify that the type was
    defined as a class, is not primitive or generic, and does not inherit
    from EntityObject.</strong></p>
  </blockquote>