views:

41

answers:

1

I just tried to use Contains in an Entity Framework query only to have it fail as this method doesn't exist in EF. However the code compiles which is frustrating.

Does anyone know how to find which methods a LINQ provider supports, given any LINQ provider?

+2  A: 

There's not really any API (that I'm aware of) that will tell you this, unfortunately.

If you're looking for an equivalent in EF, this question might help you.

The examples in that question might also help to explain why it's not so easy to determine which expressions can be used with which providers - a lot of the logic actually resides in the extension method, not the provider. Anyone can write an extension method on IQueryable<T> - it would be impossible for a provider to know whether an extension method that hasn't been written yet is going to work. And Contains is just another extension method.

Aaronaught