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.
(obj => ((DerivedClass)obj).DerivedProperty == true);
Thanks all for your help; I solved the problem by using the as operator instead of direct casting; I don't know the reason but this fixed my issue.
obj => (obj as DerivedClass).DerivedProperty == true;