+5  A: 

In the case of LINQtoSQL / Entities, the queries are all broken down into expression trees which are then passed to the provider APIs. The providers cannot provide compile time information about the trees they do or do not support because there is no syntactic difference. The only choice is for them to provide runtime data.

For example once in expression tree form, both the Single and First appear as a MethodCallExpression instance.

JaredPar
Any idea how to know or just "practice make the man perfect" ?
Asad Butt
@Asad, many providers have a list of the calls they support in their documentation but barring that it's trial and error :(
JaredPar
+2  A: 

Microsoft has a complete list of supported and unsupported methods in Linq to Entities. That's where to go to find out this information.

You'll notice that the Single and SingleOrDefault methods are in fact listed as "not supported" in the section on Paging Methods.

As Jared pointed out, the compiler does not know at compile time which provider you are using, so it has no way to enforce compile-time safety of extension methods that the provider may or may not implement. You'll have to rely on the documentation instead.

Aaronaught
Correct (+1) for EF 1. Note, however, that both methods are supported in EF 4.
Craig Stuntz
A: 

Unfortunately, it's yet another indication of both the relative immaturity of EF and the Object Relational Impedance Mismatch.

Documentation is your friend if you choose to go this route.

Mark Brackett