Chapter 11. Query expressions and LINQ to Objects
This chapter covers
- Streaming sequences of data
- Deferred execution
- Standard query operators
- Translating query expressions
- Range variables and transparent identifiers
- Projecting, filtering, and sorting
- Joining and grouping
- Choosing which syntax to use
You may be tired of all the hyperbole around LINQ by now. We’ve already seen some examples earlier in the book, and you’ve almost certainly read a lot about it on the web. This is where we separate myth from reality:
- LINQ isn’t going to turn the most complicated query into a one-liner.
- LINQ isn’t going to mean you never need to look at raw SQL again.
- LINQ isn’t going to magically imbue you with architectural genius.
Given all that, LINQ is still the best way of expressing queries that I’ve seen within an object-oriented environment. It’s not a silver bullet, but it’s a very powerful tool to have in your development armory. We’ll explore two distinct aspects of LINQ: the framework support, and the compiler translation of query expressions. The latter can look odd to start with, but I’m sure you’ll learn to love them.