Exploring LINQ Standard Query Operator Groups - dummies

Exploring LINQ Standard Query Operator Groups

By John Paul Mueller

Part of LINQ For Dummies Cheat Sheet

Using standard query operators makes working with Language INtegrated Query (LINQ) considerably easier. In many ways, you’ve probably already worked with simple query operators. For example, when you use the orderby keyword, you’re using a query operator in the sorting group of standard query operators. When you use the where keyword, you’re using another query operator, but this time it’s in the filtering group.

Here’s a list of standard query operator groups and where you can find additional information.

Group Group Description Included Operators Additional Information
Aggregation operations The aggregation operators all help you perform mathematical
tasks with a data source.
Aggregate, Average, Count, LongCount, Max, Min, and Sum Microsoft
Developer Network: Aggregation Operations
Concatenation operations The sole concatenation operator lets you combine two
Concat Microsoft
Developer Network: Concatenation Operations
Converting data types Converting data types come in two forms: deferred and
nondeferred. The deferred conversion operators convert the results
of a query to a particular type as the code interprets the result
set. The nondeferred conversion operators change the output of a
query to a particular type.
AsEnumerable, AsQueryable, Cast,
OfType, ToArray, ToDictionary, ToList,
and ToLookup
Developer Network: Converting Data Types
Element operations The element operators help you select a particular element in a
sequence, even when you don’t know any identifying information
about that element, such as its name.
ElementAt, ElementAtOrDefault, First, FirstOrDefault, Last,
LastOrDefault, Single, and SingleOrDefault
Developer Network: Element Operations
Equality operations The sole equality operator helps you determine whether two
sequences are equal (the number of elements and the content of each
element are equal).
SequenceEqual Microsoft
Developer Network: Equality Operations
Filtering data The filtering operators help you exclude or include elements in
a sequence based on specific criteria.
OfType and Where Microsoft
Developer Network: Filtering Data
Generation operations The generation operators create a new sequence based on the
criteria you specify.
DefaultIfEmpty, Empty, Range, and
Developer Network: Generation Operations
Grouping data The grouping operators help you sort data by a particular
characteristic, such as the first letter in a group of
GroupBy and ToLookup Microsoft
Developer Network: Grouping Data
Join operations The joining operators accept two or more sequences as input and
create a single output sequence based on a specific join type and
the join criteria.
Join and GroupJoin Microsoft
Developer Network: Join Operations
Partitioning data The partitioning operators help you section a sequence to
locate specific information.
Skip, SkipWhile, Take, and
Developer Network: Partitioning Data
Projection operations The projection operators create a new type based on the query
you create.
Select and SelectMany Microsoft
Developer Network: Projection Operations
Quantifier operations The quantifier operators help you select elements based on
specific criteria. You use these operators to determine whether
none, one, or more than one elements meet the selected
All, Any,
and Contains
Developer Network: Quantifier Operations
Set operations The set operators create sets. Think of the set arithmetic you
performed in school.
Distinct, Except, Intersect,
and Union
Developer Network: Set Operations
Sorting data The sorting operators help you put a sequence into a particular
OrderBy, OrderByDescending, ThenBy, ThenByDescending, and Reverse Microsoft
Developer Network: Sorting Data