There are around 50 standard LINQ operators. The rest of this chapter describes the most important operators, broken down by the main areas of functionality. We’ll show how to use them both from a query expression (where possible) and with an explicit method call.
Sometimes it’s useful to call the LINQ query operator methods
explicitly, rather than writing a query expression. Some operators offer
overloads with advanced features that are not available in a query
expression. For example, sorting strings is a locale-dependent
operation—there are variations on what constitutes alphabetical ordering
in different languages. The query expression syntax for ordering data
always uses the current thread’s default culture for ordering. If you
need to use a different culture for some reason, or you want a
culture-independent order, you’ll need to call an overload of the
OrderBy operator explicitly instead
of using an
orderby clause in a query
There are even some LINQ operators that don’t have an equivalent in a query expression. So understanding how LINQ uses methods is not just a case of looking at implementation details. It’s the only way to access some more advanced LINQ features.