Exactly how LINQ\'s \"where\" method is defined? I\'m guessing implementation is something like this:
public static IEnumerable Where ( this partialPare
The query syntax you mention for where
basically creates a method and delegate, and calls the method syntax version with it. Whatever you call where
with is turned into a single method and then called via a delegate on each element of the source sequence.
So possibly what you mean by the two checks being passed as a whole expression; that's what is happening...
where ( c.Col1 == c.Col2 || c.Col3 == c.Col4 )
it turned into a single method call like this:
bool MethodExample(var c){
return ( c.Col1 == c.Col2 || c.Col3 == c.Col4 );
}
and is then called on each element. (obviously the above is pseudo-code)