title: Entity Framework:- Error when Casting to derive class throw exception in Table per hierarchy query
body: <p>I faced an exception when i try to cast to derived class; Unable to cast the type '' to type ''. LINQ to Entities only supports casting EDM primitive or enumeration types.</p>
  
  <pre><code> (obj =&gt; ((DerivedClass)obj).DerivedProperty == true);
  </code></pre>