title: How to load only base type in Entity Framework
body: <p>Consider following case:</p>
  
  <p>I have base class inherited by another two.
  For instance we will have:</p>
  
  <pre><code>class Base
  {
  
  }
  class DerivedA : Base
  {
  
  }
  class DerivedB : Base
  {
  
  }
  </code></pre>
  
  <p>When I request base entity with code like</p>
  
  <p>context.Base.Where(q => q.Id == id).First();</p>
  
  <p>Entity Framework generate a full set of joins to every derived entity which results in below acceptable perfomance of query.
  What <strong>I want is to load only base entity</strong> without joining it to derived ones.</p>
  
  <p>The only solution I found described here <a href="http://blogs.msdn.com/b/alexj/archive/2009/09/17/tip-35-how-to-write-oftypeonly-tentity.aspx" rel="nofollow">http://blogs.msdn.com/b/alexj/archive/2009/09/17/tip-35-how-to-write-oftypeonly-tentity.aspx</a>.
  But that did not work for me. EF still generates huge query.</p>
  
  <p>Writing queries like:</p>
  
  <pre><code>context.Base.Where(q =&gt; !(q is DerivedA) &amp;&amp; !(q is DerivedB)).First();
  </code></pre>
  
  <p><strong>doesn't suits me</strong> either due to constantly increasing amount of derived types.</p>
  
  <p>Are there any possible solutions apart from those I mentioned?</p>