Tutorialsteacher

Follow Us

Standard Query Operators

Standard Query Operators in LINQ are actually extension methods for the IEnumerable<T> and IQueryable<T> types. They are defined in the System.Linq.Enumerable and System.Linq.Queryable classes. There are over 50 standard query operators available in LINQ that provide different functionalities like filtering, sorting, grouping, aggregation, concatenation, etc.

Standard Query Operators in Query Syntax

Standard Query Operators in Query Syntax

Standard Query Operators in Method Syntax

Standard Query Operators in Method Syntax

Standard query operators in query syntax is converted into extension methods at compile time. So both are same.

Standard Query Operators can be classified based on the functionality they provide. The following table lists all the classification of Standard Query Operators:

ClassificationStandard Query Operators
FilteringWhere, OfType
SortingOrderBy, OrderByDescending, ThenBy, ThenByDescending, Reverse
GroupingGroupBy, ToLookup
JoinGroupJoin, Join
ProjectionSelect, SelectMany
AggregationAggregate, Average, Count, LongCount, Max, Min, Sum
QuantifiersAll, Any, Contains
ElementsElementAt, ElementAtOrDefault, First, FirstOrDefault, Last, LastOrDefault, Single, SingleOrDefault
SetDistinct, Except, Intersect, Union
PartitioningSkip, SkipWhile, Take, TakeWhile
ConcatenationConcat
EqualitySequenceEqual
GenerationDefaultEmpty, Empty, Range, Repeat
ConversionAsEnumerable, AsQueryable, Cast, ToArray, ToDictionary, ToList

Learn each Standard Query Operators in the next sections.