Hello everybody
I am trying to filter derived classes in my entities but i am getting exception.
var filtered = db.PersonSet.OfType<Person>().
Where(person =>person.GetType()==typeof(Person))
I am getting below exception if i try to loop filtered collection by foreach.
"LINQ to Entities does not recognize the method 'System.Type GetType()' method, and this method cannot be translated into a store expression.".
How can i overcome it ? What can be alternative way for filtering ?