C# in Depth

Cover of C# in Depth
Order now (3rd edition)

Truly silly query expressions

Chapter 11: Query expressions and LINQ to Objects: 11.1.2

Created: 3/5/2008
Last updated: 6/21/2008

It's important to understand that the process of translating a query expression into method calls is purely syntactic - that's how it's able to work in radically different ways with different providers.

I have a blog entry demonstrating just how silly things can get - you can make query expressions call static methods or delegates, if you provide the right (somewhat strange) data source.

If you build a LINQ provider which makes Select return an int, so be it. You shouldn't expect anyone to actually use it, but the compiler won't care at all.