Linq Support
LINQ is a collection of extension methods that extend the IEnumerable<T>
interface. There are around 50 unique methods currently available in LINQ (even more if you count different signature variations as separate methods)! The complete list can be found here:
Some methods are very simple, such as the Count()
method. On the other hand, several LINQ methods are very complicated and difficult to understand. The GroupJoin()
method would be a good example of this.
General method categories
Some methods return a single element from the target sequence, such as
First()
orLast()
.
Some methods return multiple elements out of the target sequence, such as
Take()
,Skip()
, andWhere()
.
Methods
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. | |
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. | |
Applies an accumulator function over a sequence. | |
Determines whether all elements of a sequence satisfy a condition. | |
Determines whether a sequence contains any elements. | |
Determines whether any element of a sequence satisfies a condition. | |
Appends a value to the end of the sequence. | |
Returns the input typed as IEnumerable<T>. | |
Computes the average of a sequence of Single values. | |
Computes the average of a sequence of nullable Single values. | |
Computes the average of a sequence of nullable Int64 values. | |
Computes the average of a sequence of nullable Int32 values. | |
Computes the average of a sequence of nullable Double values. | |
Computes the average of a sequence of Int64 values. | |
Computes the average of a sequence of Int32 values. | |
Computes the average of a sequence of Double values. | |
Computes the average of a sequence of Decimal values. | |
Computes the average of a sequence of nullable Decimal values. | |
Computes the average of a sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the average of a sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the average of a sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the average of a sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the average of a sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the average of a sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the average of a sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the average of a sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the average of a sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the average of a sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. | |
Casts the elements of an IEnumerable to the specified type. | |
Concatenates two sequences. | |
Determines whether a sequence contains a specified element by using the default equality comparer. | |
Determines whether a sequence contains a specified element by using a specified IEqualityComparer<T>. | |
Returns the number of elements in a sequence. | |
Returns a number that represents how many elements in the specified sequence satisfy a condition. | |
Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty. | |
Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty. | |
Returns distinct elements from a sequence by using the default equality comparer to compare values. | |
Returns distinct elements from a sequence by using a specified IEqualityComparer<T> to compare values. | |
Returns the element at a specified index in a sequence. | |
Returns the element at a specified index in a sequence or a default value if the index is out of range. | |
Returns an empty IEnumerable<T> that has the specified type argument. | |
Produces the set difference of two sequences by using the default equality comparer to compare values. | |
Produces the set difference of two sequences by using the specified IEqualityComparer<T> to compare values. | |
Returns the first element of a sequence. | |
Returns the first element in a sequence that satisfies a specified condition. | |
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. | |
Returns the first element of a sequence, or a default value if the sequence contains no elements. | |
Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function. | |
Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function. | |
Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function. | |
Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function. | |
Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. | |
Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer. | |
Groups the elements of a sequence according to a specified key selector function. | |
Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer. | |
Correlates the elements of two sequences based on key equality and groups the results. A specified IEqualityComparer<T> is used to compare keys. | |
Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. | |
Produces the set intersection of two sequences by using the specified IEqualityComparer<T> to compare values. | |
Produces the set intersection of two sequences by using the default equality comparer to compare values. | |
Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. | |
Correlates the elements of two sequences based on matching keys. A specified IEqualityComparer<T> is used to compare keys. | |
Returns the last element of a sequence. | |
Returns the last element of a sequence that satisfies a specified condition. | |
Returns the last element of a sequence, or a default value if the sequence contains no elements. | |
Returns the last element of a sequence that satisfies a condition or a default value if no such element is found. | |
Returns an Int64 that represents how many elements in a sequence satisfy a condition. | |
Returns an Int64 that represents the total number of elements in a sequence. | |
Returns the maximum value in a sequence of nullable Single values. | |
Returns the maximum value in a sequence of Int32 values. | |
Returns the maximum value in a sequence of nullable Int64 values. | |
Returns the maximum value in a sequence of Single values. | |
Returns the maximum value in a sequence of nullable Int32 values. | |
Returns the maximum value in a sequence of Decimal values. | |
Returns the maximum value in a sequence of nullable Decimal values. | |
Returns the maximum value in a sequence of Int64 values. | |
Returns the maximum value in a sequence of Double values. | |
Returns the maximum value in a sequence of nullable Double values. | |
Invokes a transform function on each element of a generic sequence and returns the maximum resulting value. | |
Invokes a transform function on each element of a sequence and returns the maximum Single value. | |
Invokes a transform function on each element of a sequence and returns the maximum nullable Single value. | |
Invokes a transform function on each element of a sequence and returns the maximum nullable Int64 value. | |
Invokes a transform function on each element of a sequence and returns the maximum nullable Int32 value. | |
Invokes a transform function on each element of a sequence and returns the maximum nullable Double value. | |
Invokes a transform function on each element of a sequence and returns the maximum Int64 value. | |
Invokes a transform function on each element of a sequence and returns the maximum Int32 value. | |
Invokes a transform function on each element of a sequence and returns the maximum Double value. | |
Invokes a transform function on each element of a sequence and returns the maximum Decimal value. | |
Returns the maximum value in a generic sequence. | |
Invokes a transform function on each element of a sequence and returns the maximum nullable Decimal value. | |
Returns the minimum value in a sequence of nullable Int64 values. | |
Returns the minimum value in a sequence of nullable Int32 values. | |
Returns the minimum value in a sequence of Single values. | |
Returns the minimum value in a sequence of nullable Single values. | |
Returns the minimum value in a sequence of nullable Double values. | |
Returns the minimum value in a sequence of Double values. | |
Returns the minimum value in a sequence of Int64 values. | |
Returns the minimum value in a sequence of Int32 values. | |
Returns the minimum value in a sequence of nullable Decimal values. | |
Returns the minimum value in a sequence of Decimal values. | |
Invokes a transform function on each element of a generic sequence and returns the minimum resulting value. | |
Invokes a transform function on each element of a sequence and returns the minimum Single value. | |
Invokes a transform function on each element of a sequence and returns the minimum nullable Single value. | |
Invokes a transform function on each element of a sequence and returns the minimum nullable Int64 value. | |
Invokes a transform function on each element of a sequence and returns the minimum nullable Int32 value. | |
Invokes a transform function on each element of a sequence and returns the minimum nullable Double value. | |
Invokes a transform function on each element of a sequence and returns the minimum Int64 value. | |
Invokes a transform function on each element of a sequence and returns the minimum Int32 value. | |
Invokes a transform function on each element of a sequence and returns the minimum Double value. | |
Invokes a transform function on each element of a sequence and returns the minimum Decimal value. | |
Returns the minimum value in a generic sequence. | |
Invokes a transform function on each element of a sequence and returns the minimum nullable Decimal value. | |
Filters the elements of an IEnumerable based on a specified type. | |
Sorts the elements of a sequence in ascending order according to a key. | |
Sorts the elements of a sequence in ascending order by using a specified comparer. | |
Sorts the elements of a sequence in descending order by using a specified comparer. | |
Sorts the elements of a sequence in descending order according to a key. | |
Adds a value to the beginning of the sequence. | |
Generates a sequence of integral numbers within a specified range. | |
Generates a sequence that contains one repeated value. | |
Inverts the order of the elements in a sequence. | |
Projects each element of a sequence into a new form by incorporating the element's index. | |
Projects each element of a sequence into a new form. | |
Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. | |
Projects each element of a sequence to an IEnumerable<T>, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element. | |
Projects each element of a sequence to an IEnumerable<T> and flattens the resulting sequences into one sequence. | |
Projects each element of a sequence to an IEnumerable<T>, and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. | |
Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type. | |
Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer<T>. | |
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. | |
Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. | |
Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence. | |
Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. | |
Bypasses a specified number of elements in a sequence and then returns the remaining elements. | |
Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. | |
Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function. | |
Computes the sum of a sequence of nullable Int32 values. | |
Computes the sum of a sequence of nullable Single values. | |
Computes the sum of a sequence of nullable Int64 values. | |
Computes the sum of a sequence of Single values. | |
Computes the sum of a sequence of nullable Double values. | |
Computes the sum of a sequence of Int32 values. | |
Computes the sum of a sequence of Int64 values. | |
Computes the sum of a sequence of Double values. | |
Computes the sum of a sequence of Decimal values. | |
Computes the sum of a sequence of nullable Decimal values. | |
Computes the sum of the sequence of Single values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the sum of the sequence of nullable Single values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the sum of the sequence of nullable Int64 values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the sum of the sequence of nullable Int32 values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the sum of the sequence of nullable Double values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the sum of the sequence of nullable Decimal values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the sum of the sequence of Int64 values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the sum of the sequence of Int32 values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the sum of the sequence of Double values that are obtained by invoking a transform function on each element of the input sequence. | |
Computes the sum of the sequence of Decimal values that are obtained by invoking a transform function on each element of the input sequence. | |
Returns a specified number of contiguous elements from the start of a sequence. | |
Returns elements from a sequence as long as a specified condition is true. | |
Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. | |
Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer. | |
Performs a subsequent ordering of the elements in a sequence in ascending order according to a key. | |
Performs a subsequent ordering of the elements in a sequence in descending order, according to a key. | |
Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer. | |
Creates an array from a IEnumerable<T>. | |
Creates a Dictionary<TKey,TValue> from an IEnumerable<T> according to specified key selector and element selector functions. | |
Creates a Dictionary<TKey,TValue> from an IEnumerable<T> according to a specified key selector function, a comparer, and an element selector function. | |
Creates a Dictionary<TKey,TValue> from an IEnumerable<T> according to a specified key selector function. | |
Creates a Dictionary<TKey,TValue> from an IEnumerable<T> according to a specified key selector function and key comparer. | |
Creates a HashSet<T> from an IEnumerable<T> using the | |
Creates a HashSet<T> from an IEnumerable<T>. | |
Creates a List<T> from an IEnumerable<T>. | |
Creates a Lookup<TKey,TElement> from an IEnumerable<T> according to specified key selector and element selector functions. | |
Creates a Lookup<TKey,TElement> from an IEnumerable<T> according to a specified key selector function, a comparer and an element selector function. | |
Creates a Lookup<TKey,TElement> from an IEnumerable<T> according to a specified key selector function. | |
Creates a Lookup<TKey,TElement> from an IEnumerable<T> according to a specified key selector function and key comparer. | |
Produces the set union of two sequences by using the default equality comparer. | |
Produces the set union of two sequences by using a specified IEqualityComparer<T>. | |
Filters a sequence of values based on a predicate. | |
Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. | |
Applies a specified function to the corresponding elements of two sequences, producing a sequence of the re |
Last updated