How can I use cast in Linq to Entities?
I need something like this:
if (typeof(myObject) is IMyInterface)
{
return MyObjectSet.Where(x => ((IMyInterface)x).MyProperty == 1);
}
If I try above code, I get an exception. It's an expected behavior of EF or it's a bug?