mscorlib(4.0.0.0) API with additions
System.Linq.Enumerable Class Reference

Provides a set of static (Shared in Visual Basic) methods for querying objects that implement T:System.Collections.Generic.IEnumerable`1. More...

Static Public Member Functions

static IEnumerable< TSource > Where< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Filters a sequence of values based on a predicate. More...
 
static IEnumerable< TSource > Where< TSource > (this IEnumerable< TSource > source, Func< TSource, int, bool > predicate)
 Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. More...
 
static IEnumerable< TResult > Select< TSource, TResult > (this IEnumerable< TSource > source, Func< TSource, TResult > selector)
 Projects each element of a sequence into a new form. More...
 
static IEnumerable< TResult > Select< TSource, TResult > (this IEnumerable< TSource > source, Func< TSource, int, TResult > selector)
 Projects each element of a sequence into a new form by incorporating the element's index. More...
 
static IEnumerable< TResult > SelectMany< TSource, TResult > (this IEnumerable< TSource > source, Func< TSource, IEnumerable< TResult >> selector)
 Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1 and flattens the resulting sequences into one sequence. More...
 
static IEnumerable< TResult > SelectMany< TSource, TResult > (this IEnumerable< TSource > source, Func< TSource, int, IEnumerable< TResult >> selector)
 Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1, and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. More...
 
static IEnumerable< TResult > SelectMany< TSource, TCollection, TResult > (this IEnumerable< TSource > source, Func< TSource, int, IEnumerable< TCollection >> collectionSelector, Func< TSource, TCollection, TResult > resultSelector)
 Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1, 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. More...
 
static IEnumerable< TResult > SelectMany< TSource, TCollection, TResult > (this IEnumerable< TSource > source, Func< TSource, IEnumerable< TCollection >> collectionSelector, Func< TSource, TCollection, TResult > resultSelector)
 Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. More...
 
static IEnumerable< TSource > Take< TSource > (this IEnumerable< TSource > source, int count)
 Returns a specified number of contiguous elements from the start of a sequence. More...
 
static IEnumerable< TSource > TakeWhile< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Returns elements from a sequence as long as a specified condition is true. More...
 
static IEnumerable< TSource > TakeWhile< TSource > (this IEnumerable< TSource > source, Func< TSource, int, bool > predicate)
 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. More...
 
static IEnumerable< TSource > Skip< TSource > (this IEnumerable< TSource > source, int count)
 Bypasses a specified number of elements in a sequence and then returns the remaining elements. More...
 
static IEnumerable< TSource > SkipWhile< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. More...
 
static IEnumerable< TSource > SkipWhile< TSource > (this IEnumerable< TSource > source, Func< TSource, int, bool > predicate)
 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. More...
 
static IEnumerable< TResult > Join< TOuter, TInner, TKey, TResult > (this IEnumerable< TOuter > outer, IEnumerable< TInner > inner, Func< TOuter, TKey > outerKeySelector, Func< TInner, TKey > innerKeySelector, Func< TOuter, TInner, TResult > resultSelector)
 Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. More...
 
static IEnumerable< TResult > Join< TOuter, TInner, TKey, TResult > (this IEnumerable< TOuter > outer, IEnumerable< TInner > inner, Func< TOuter, TKey > outerKeySelector, Func< TInner, TKey > innerKeySelector, Func< TOuter, TInner, TResult > resultSelector, IEqualityComparer< TKey > comparer)
 Correlates the elements of two sequences based on matching keys. A specified T:System.Collections.Generic.IEqualityComparer`1 is used to compare keys. More...
 
static IEnumerable< TResult > GroupJoin< TOuter, TInner, TKey, TResult > (this IEnumerable< TOuter > outer, IEnumerable< TInner > inner, Func< TOuter, TKey > outerKeySelector, Func< TInner, TKey > innerKeySelector, Func< TOuter, IEnumerable< TInner >, TResult > resultSelector)
 Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. More...
 
static IEnumerable< TResult > GroupJoin< TOuter, TInner, TKey, TResult > (this IEnumerable< TOuter > outer, IEnumerable< TInner > inner, Func< TOuter, TKey > outerKeySelector, Func< TInner, TKey > innerKeySelector, Func< TOuter, IEnumerable< TInner >, TResult > resultSelector, IEqualityComparer< TKey > comparer)
 Correlates the elements of two sequences based on key equality and groups the results. A specified T:System.Collections.Generic.IEqualityComparer`1 is used to compare keys. More...
 
static IOrderedEnumerable< TSource > OrderBy< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector)
 Sorts the elements of a sequence in ascending order according to a key. More...
 
static IOrderedEnumerable< TSource > OrderBy< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, IComparer< TKey > comparer)
 Sorts the elements of a sequence in ascending order by using a specified comparer. More...
 
static IOrderedEnumerable< TSource > OrderByDescending< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector)
 Sorts the elements of a sequence in descending order according to a key. More...
 
static IOrderedEnumerable< TSource > OrderByDescending< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, IComparer< TKey > comparer)
 Sorts the elements of a sequence in descending order by using a specified comparer. More...
 
static IOrderedEnumerable< TSource > ThenBy< TSource, TKey > (this IOrderedEnumerable< TSource > source, Func< TSource, TKey > keySelector)
 Performs a subsequent ordering of the elements in a sequence in ascending order according to a key. More...
 
static IOrderedEnumerable< TSource > ThenBy< TSource, TKey > (this IOrderedEnumerable< TSource > source, Func< TSource, TKey > keySelector, IComparer< TKey > comparer)
 Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer. More...
 
static IOrderedEnumerable< TSource > ThenByDescending< TSource, TKey > (this IOrderedEnumerable< TSource > source, Func< TSource, TKey > keySelector)
 Performs a subsequent ordering of the elements in a sequence in descending order, according to a key. More...
 
static IOrderedEnumerable< TSource > ThenByDescending< TSource, TKey > (this IOrderedEnumerable< TSource > source, Func< TSource, TKey > keySelector, IComparer< TKey > comparer)
 Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer. More...
 
static IEnumerable< IGrouping< TKey, TSource > > GroupBy< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector)
 Groups the elements of a sequence according to a specified key selector function. More...
 
static IEnumerable< IGrouping< TKey, TSource > > GroupBy< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, IEqualityComparer< TKey > comparer)
 Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer. More...
 
static IEnumerable< IGrouping< TKey, TElement > > GroupBy< TSource, TKey, TElement > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector)
 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. More...
 
static IEnumerable< IGrouping< TKey, TElement > > GroupBy< TSource, TKey, TElement > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector, IEqualityComparer< TKey > comparer)
 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. More...
 
static IEnumerable< TResult > GroupBy< TSource, TKey, TResult > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TKey, IEnumerable< TSource >, TResult > resultSelector)
 Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. More...
 
static IEnumerable< TResult > GroupBy< TSource, TKey, TElement, TResult > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector, Func< TKey, IEnumerable< TElement >, TResult > resultSelector)
 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. More...
 
static IEnumerable< TResult > GroupBy< TSource, TKey, TResult > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TKey, IEnumerable< TSource >, TResult > resultSelector, IEqualityComparer< TKey > comparer)
 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. More...
 
static IEnumerable< TResult > GroupBy< TSource, TKey, TElement, TResult > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector, Func< TKey, IEnumerable< TElement >, TResult > resultSelector, IEqualityComparer< TKey > comparer)
 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. More...
 
static IEnumerable< TSource > Concat< TSource > (this IEnumerable< TSource > first, IEnumerable< TSource > second)
 Concatenates two sequences. More...
 
static IEnumerable< TResult > Zip< TFirst, TSecond, TResult > (this IEnumerable< TFirst > first, IEnumerable< TSecond > second, Func< TFirst, TSecond, TResult > resultSelector)
 Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results. More...
 
static IEnumerable< TSource > Distinct< TSource > (this IEnumerable< TSource > source)
 Returns distinct elements from a sequence by using the default equality comparer to compare values. More...
 
static IEnumerable< TSource > Distinct< TSource > (this IEnumerable< TSource > source, IEqualityComparer< TSource > comparer)
 Returns distinct elements from a sequence by using a specified T:System.Collections.Generic.IEqualityComparer`1 to compare values. More...
 
static IEnumerable< TSource > Union< TSource > (this IEnumerable< TSource > first, IEnumerable< TSource > second)
 Produces the set union of two sequences by using the default equality comparer. More...
 
static IEnumerable< TSource > Union< TSource > (this IEnumerable< TSource > first, IEnumerable< TSource > second, IEqualityComparer< TSource > comparer)
 Produces the set union of two sequences by using a specified T:System.Collections.Generic.IEqualityComparer`1. More...
 
static IEnumerable< TSource > Intersect< TSource > (this IEnumerable< TSource > first, IEnumerable< TSource > second)
 Produces the set intersection of two sequences by using the default equality comparer to compare values. More...
 
static IEnumerable< TSource > Intersect< TSource > (this IEnumerable< TSource > first, IEnumerable< TSource > second, IEqualityComparer< TSource > comparer)
 Produces the set intersection of two sequences by using the specified T:System.Collections.Generic.IEqualityComparer`1 to compare values. More...
 
static IEnumerable< TSource > Except< TSource > (this IEnumerable< TSource > first, IEnumerable< TSource > second)
 Produces the set difference of two sequences by using the default equality comparer to compare values. More...
 
static IEnumerable< TSource > Except< TSource > (this IEnumerable< TSource > first, IEnumerable< TSource > second, IEqualityComparer< TSource > comparer)
 Produces the set difference of two sequences by using the specified T:System.Collections.Generic.IEqualityComparer`1 to compare values. More...
 
static IEnumerable< TSource > Reverse< TSource > (this IEnumerable< TSource > source)
 Inverts the order of the elements in a sequence. More...
 
static bool SequenceEqual< TSource > (this IEnumerable< TSource > first, IEnumerable< TSource > second)
 Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type. More...
 
static bool SequenceEqual< TSource > (this IEnumerable< TSource > first, IEnumerable< TSource > second, IEqualityComparer< TSource > comparer)
 Determines whether two sequences are equal by comparing their elements by using a specified T:System.Collections.Generic.IEqualityComparer`1. More...
 
static IEnumerable< TSource > AsEnumerable< TSource > (this IEnumerable< TSource > source)
 Returns the input typed as T:System.Collections.Generic.IEnumerable`1. More...
 
static TSource [] ToArray< TSource > (this IEnumerable< TSource > source)
 Creates an array from a T:System.Collections.Generic.IEnumerable`1. More...
 
static List< TSource > ToList< TSource > (this IEnumerable< TSource > source)
 Creates a T:System.Collections.Generic.List`1 from an T:System.Collections.Generic.IEnumerable`1. More...
 
static Dictionary< TKey, TSource > ToDictionary< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector)
 Creates a T:System.Collections.Generic.Dictionary`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function. More...
 
static Dictionary< TKey, TSource > ToDictionary< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, IEqualityComparer< TKey > comparer)
 Creates a T:System.Collections.Generic.Dictionary`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function and key comparer. More...
 
static Dictionary< TKey, TElement > ToDictionary< TSource, TKey, TElement > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector)
 Creates a T:System.Collections.Generic.Dictionary`2 from an T:System.Collections.Generic.IEnumerable`1 according to specified key selector and element selector functions. More...
 
static Dictionary< TKey, TElement > ToDictionary< TSource, TKey, TElement > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector, IEqualityComparer< TKey > comparer)
 Creates a T:System.Collections.Generic.Dictionary`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function, a comparer, and an element selector function. More...
 
static ILookup< TKey, TSource > ToLookup< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector)
 Creates a T:System.Linq.Lookup`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function. More...
 
static ILookup< TKey, TSource > ToLookup< TSource, TKey > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, IEqualityComparer< TKey > comparer)
 Creates a T:System.Linq.Lookup`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function and key comparer. More...
 
static ILookup< TKey, TElement > ToLookup< TSource, TKey, TElement > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector)
 Creates a T:System.Linq.Lookup`2 from an T:System.Collections.Generic.IEnumerable`1 according to specified key selector and element selector functions. More...
 
static ILookup< TKey, TElement > ToLookup< TSource, TKey, TElement > (this IEnumerable< TSource > source, Func< TSource, TKey > keySelector, Func< TSource, TElement > elementSelector, IEqualityComparer< TKey > comparer)
 Creates a T:System.Linq.Lookup`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function, a comparer and an element selector function. More...
 
static IEnumerable< TSource > DefaultIfEmpty< TSource > (this IEnumerable< TSource > source)
 Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty. More...
 
static IEnumerable< TSource > DefaultIfEmpty< TSource > (this IEnumerable< TSource > source, TSource defaultValue)
 Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty. More...
 
static IEnumerable< TResult > OfType< TResult > (this IEnumerable source)
 Filters the elements of an T:System.Collections.IEnumerable based on a specified type. More...
 
static IEnumerable< TResult > Cast< TResult > (this IEnumerable source)
 Casts the elements of an T:System.Collections.IEnumerable to the specified type. More...
 
static TSource First< TSource > (this IEnumerable< TSource > source)
 Returns the first element of a sequence. More...
 
static TSource First< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Returns the first element in a sequence that satisfies a specified condition. More...
 
static TSource FirstOrDefault< TSource > (this IEnumerable< TSource > source)
 Returns the first element of a sequence, or a default value if the sequence contains no elements. More...
 
static TSource FirstOrDefault< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. More...
 
static TSource Last< TSource > (this IEnumerable< TSource > source)
 Returns the last element of a sequence. More...
 
static TSource Last< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Returns the last element of a sequence that satisfies a specified condition. More...
 
static TSource LastOrDefault< TSource > (this IEnumerable< TSource > source)
 Returns the last element of a sequence, or a default value if the sequence contains no elements. More...
 
static TSource LastOrDefault< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Returns the last element of a sequence that satisfies a condition or a default value if no such element is found. More...
 
static TSource Single< TSource > (this IEnumerable< TSource > source)
 Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. More...
 
static TSource Single< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. More...
 
static TSource SingleOrDefault< TSource > (this IEnumerable< TSource > source)
 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. More...
 
static TSource SingleOrDefault< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 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. More...
 
static TSource ElementAt< TSource > (this IEnumerable< TSource > source, int index)
 Returns the element at a specified index in a sequence. More...
 
static TSource ElementAtOrDefault< TSource > (this IEnumerable< TSource > source, int index)
 Returns the element at a specified index in a sequence or a default value if the index is out of range. More...
 
static IEnumerable< int > Range (int start, int count)
 Generates a sequence of integral numbers within a specified range. More...
 
static IEnumerable< TResult > Repeat< TResult > (TResult element, int count)
 Generates a sequence that contains one repeated value. More...
 
static IEnumerable< TResult > Empty< TResult > ()
 Returns an empty T:System.Collections.Generic.IEnumerable`1 that has the specified type argument. More...
 
static bool Any< TSource > (this IEnumerable< TSource > source)
 Determines whether a sequence contains any elements. More...
 
static bool Any< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Determines whether any element of a sequence satisfies a condition. More...
 
static bool All< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Determines whether all elements of a sequence satisfy a condition. More...
 
static int Count< TSource > (this IEnumerable< TSource > source)
 Returns the number of elements in a sequence. More...
 
static int Count< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Returns a number that represents how many elements in the specified sequence satisfy a condition. More...
 
static long LongCount< TSource > (this IEnumerable< TSource > source)
 Returns an T:System.Int64 that represents the total number of elements in a sequence. More...
 
static long LongCount< TSource > (this IEnumerable< TSource > source, Func< TSource, bool > predicate)
 Returns an T:System.Int64 that represents how many elements in a sequence satisfy a condition. More...
 
static bool Contains< TSource > (this IEnumerable< TSource > source, TSource value)
 Determines whether a sequence contains a specified element by using the default equality comparer. More...
 
static bool Contains< TSource > (this IEnumerable< TSource > source, TSource value, IEqualityComparer< TSource > comparer)
 Determines whether a sequence contains a specified element by using a specified T:System.Collections.Generic.IEqualityComparer`1. More...
 
static TSource Aggregate< TSource > (this IEnumerable< TSource > source, Func< TSource, TSource, TSource > func)
 Applies an accumulator function over a sequence. More...
 
static TAccumulate Aggregate< TSource, TAccumulate > (this IEnumerable< TSource > source, TAccumulate seed, Func< TAccumulate, TSource, TAccumulate > func)
 Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. More...
 
static TResult Aggregate< TSource, TAccumulate, TResult > (this IEnumerable< TSource > source, TAccumulate seed, Func< TAccumulate, TSource, TAccumulate > func, Func< TAccumulate, TResult > resultSelector)
 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. More...
 
static int Sum (this IEnumerable< int > source)
 Computes the sum of a sequence of T:System.Int32 values. More...
 
static ? int Sum (this IEnumerable< int?> source)
 Computes the sum of a sequence of nullable T:System.Int32 values. More...
 
static long Sum (this IEnumerable< long > source)
 Computes the sum of a sequence of T:System.Int64 values. More...
 
static ? long Sum (this IEnumerable< long?> source)
 Computes the sum of a sequence of nullable T:System.Int64 values. More...
 
static float Sum (this IEnumerable< float > source)
 Computes the sum of a sequence of T:System.Single values. More...
 
static ? float Sum (this IEnumerable< float?> source)
 Computes the sum of a sequence of nullable T:System.Single values. More...
 
static double Sum (this IEnumerable< double > source)
 Computes the sum of a sequence of T:System.Double values. More...
 
static ? double Sum (this IEnumerable< double?> source)
 Computes the sum of a sequence of nullable T:System.Double values. More...
 
static decimal Sum (this IEnumerable< decimal > source)
 Computes the sum of a sequence of T:System.Decimal values. More...
 
static ? decimal Sum (this IEnumerable< decimal?> source)
 Computes the sum of a sequence of nullable T:System.Decimal values. More...
 
static int Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, int > selector)
 Computes the sum of the sequence of T:System.Int32 values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? int Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, int?> selector)
 Computes the sum of the sequence of nullable T:System.Int32 values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static long Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, long > selector)
 Computes the sum of the sequence of T:System.Int64 values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? long Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, long?> selector)
 Computes the sum of the sequence of nullable T:System.Int64 values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static float Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, float > selector)
 Computes the sum of the sequence of T:System.Single values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? float Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, float?> selector)
 Computes the sum of the sequence of nullable T:System.Single values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static double Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, double > selector)
 Computes the sum of the sequence of T:System.Double values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? double Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, double?> selector)
 Computes the sum of the sequence of nullable T:System.Double values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static decimal Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, decimal > selector)
 Computes the sum of the sequence of T:System.Decimal values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? decimal Sum< TSource > (this IEnumerable< TSource > source, Func< TSource, decimal?> selector)
 Computes the sum of the sequence of nullable T:System.Decimal values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static int Min (this IEnumerable< int > source)
 Returns the minimum value in a sequence of T:System.Int32 values. More...
 
static ? int Min (this IEnumerable< int?> source)
 Returns the minimum value in a sequence of nullable T:System.Int32 values. More...
 
static long Min (this IEnumerable< long > source)
 Returns the minimum value in a sequence of T:System.Int64 values. More...
 
static ? long Min (this IEnumerable< long?> source)
 Returns the minimum value in a sequence of nullable T:System.Int64 values. More...
 
static float Min (this IEnumerable< float > source)
 Returns the minimum value in a sequence of T:System.Single values. More...
 
static ? float Min (this IEnumerable< float?> source)
 Returns the minimum value in a sequence of nullable T:System.Single values. More...
 
static double Min (this IEnumerable< double > source)
 Returns the minimum value in a sequence of T:System.Double values. More...
 
static ? double Min (this IEnumerable< double?> source)
 Returns the minimum value in a sequence of nullable T:System.Double values. More...
 
static decimal Min (this IEnumerable< decimal > source)
 Returns the minimum value in a sequence of T:System.Decimal values. More...
 
static ? decimal Min (this IEnumerable< decimal?> source)
 Returns the minimum value in a sequence of nullable T:System.Decimal values. More...
 
static TSource Min< TSource > (this IEnumerable< TSource > source)
 Returns the minimum value in a generic sequence. More...
 
static int Min< TSource > (this IEnumerable< TSource > source, Func< TSource, int > selector)
 Invokes a transform function on each element of a sequence and returns the minimum T:System.Int32 value. More...
 
static ? int Min< TSource > (this IEnumerable< TSource > source, Func< TSource, int?> selector)
 Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Int32 value. More...
 
static long Min< TSource > (this IEnumerable< TSource > source, Func< TSource, long > selector)
 Invokes a transform function on each element of a sequence and returns the minimum T:System.Int64 value. More...
 
static ? long Min< TSource > (this IEnumerable< TSource > source, Func< TSource, long?> selector)
 Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Int64 value. More...
 
static float Min< TSource > (this IEnumerable< TSource > source, Func< TSource, float > selector)
 Invokes a transform function on each element of a sequence and returns the minimum T:System.Single value. More...
 
static ? float Min< TSource > (this IEnumerable< TSource > source, Func< TSource, float?> selector)
 Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Single value. More...
 
static double Min< TSource > (this IEnumerable< TSource > source, Func< TSource, double > selector)
 Invokes a transform function on each element of a sequence and returns the minimum T:System.Double value. More...
 
static ? double Min< TSource > (this IEnumerable< TSource > source, Func< TSource, double?> selector)
 Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Double value. More...
 
static decimal Min< TSource > (this IEnumerable< TSource > source, Func< TSource, decimal > selector)
 Invokes a transform function on each element of a sequence and returns the minimum T:System.Decimal value. More...
 
static ? decimal Min< TSource > (this IEnumerable< TSource > source, Func< TSource, decimal?> selector)
 Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Decimal value. More...
 
static TResult Min< TSource, TResult > (this IEnumerable< TSource > source, Func< TSource, TResult > selector)
 Invokes a transform function on each element of a generic sequence and returns the minimum resulting value. More...
 
static int Max (this IEnumerable< int > source)
 Returns the maximum value in a sequence of T:System.Int32 values. More...
 
static ? int Max (this IEnumerable< int?> source)
 Returns the maximum value in a sequence of nullable T:System.Int32 values. More...
 
static long Max (this IEnumerable< long > source)
 Returns the maximum value in a sequence of T:System.Int64 values. More...
 
static ? long Max (this IEnumerable< long?> source)
 Returns the maximum value in a sequence of nullable T:System.Int64 values. More...
 
static double Max (this IEnumerable< double > source)
 Returns the maximum value in a sequence of T:System.Double values. More...
 
static ? double Max (this IEnumerable< double?> source)
 Returns the maximum value in a sequence of nullable T:System.Double values. More...
 
static float Max (this IEnumerable< float > source)
 Returns the maximum value in a sequence of T:System.Single values. More...
 
static ? float Max (this IEnumerable< float?> source)
 Returns the maximum value in a sequence of nullable T:System.Single values. More...
 
static decimal Max (this IEnumerable< decimal > source)
 Returns the maximum value in a sequence of T:System.Decimal values. More...
 
static ? decimal Max (this IEnumerable< decimal?> source)
 Returns the maximum value in a sequence of nullable T:System.Decimal values. More...
 
static TSource Max< TSource > (this IEnumerable< TSource > source)
 Returns the maximum value in a generic sequence. More...
 
static int Max< TSource > (this IEnumerable< TSource > source, Func< TSource, int > selector)
 Invokes a transform function on each element of a sequence and returns the maximum T:System.Int32 value. More...
 
static ? int Max< TSource > (this IEnumerable< TSource > source, Func< TSource, int?> selector)
 Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Int32 value. More...
 
static long Max< TSource > (this IEnumerable< TSource > source, Func< TSource, long > selector)
 Invokes a transform function on each element of a sequence and returns the maximum T:System.Int64 value. More...
 
static ? long Max< TSource > (this IEnumerable< TSource > source, Func< TSource, long?> selector)
 Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Int64 value. More...
 
static float Max< TSource > (this IEnumerable< TSource > source, Func< TSource, float > selector)
 Invokes a transform function on each element of a sequence and returns the maximum T:System.Single value. More...
 
static ? float Max< TSource > (this IEnumerable< TSource > source, Func< TSource, float?> selector)
 Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Single value. More...
 
static double Max< TSource > (this IEnumerable< TSource > source, Func< TSource, double > selector)
 Invokes a transform function on each element of a sequence and returns the maximum T:System.Double value. More...
 
static ? double Max< TSource > (this IEnumerable< TSource > source, Func< TSource, double?> selector)
 Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Double value. More...
 
static decimal Max< TSource > (this IEnumerable< TSource > source, Func< TSource, decimal > selector)
 Invokes a transform function on each element of a sequence and returns the maximum T:System.Decimal value. More...
 
static ? decimal Max< TSource > (this IEnumerable< TSource > source, Func< TSource, decimal?> selector)
 Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Decimal value. More...
 
static TResult Max< TSource, TResult > (this IEnumerable< TSource > source, Func< TSource, TResult > selector)
 Invokes a transform function on each element of a generic sequence and returns the maximum resulting value. More...
 
static double Average (this IEnumerable< int > source)
 Computes the average of a sequence of T:System.Int32 values. More...
 
static ? double Average (this IEnumerable< int?> source)
 Computes the average of a sequence of nullable T:System.Int32 values. More...
 
static double Average (this IEnumerable< long > source)
 Computes the average of a sequence of T:System.Int64 values. More...
 
static ? double Average (this IEnumerable< long?> source)
 Computes the average of a sequence of nullable T:System.Int64 values. More...
 
static float Average (this IEnumerable< float > source)
 Computes the average of a sequence of T:System.Single values. More...
 
static ? float Average (this IEnumerable< float?> source)
 Computes the average of a sequence of nullable T:System.Single values. More...
 
static double Average (this IEnumerable< double > source)
 Computes the average of a sequence of T:System.Double values. More...
 
static ? double Average (this IEnumerable< double?> source)
 Computes the average of a sequence of nullable T:System.Double values. More...
 
static decimal Average (this IEnumerable< decimal > source)
 Computes the average of a sequence of T:System.Decimal values. More...
 
static ? decimal Average (this IEnumerable< decimal?> source)
 Computes the average of a sequence of nullable T:System.Decimal values. More...
 
static double Average< TSource > (this IEnumerable< TSource > source, Func< TSource, int > selector)
 Computes the average of a sequence of T:System.Int32 values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? double Average< TSource > (this IEnumerable< TSource > source, Func< TSource, int?> selector)
 Computes the average of a sequence of nullable T:System.Int32 values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static double Average< TSource > (this IEnumerable< TSource > source, Func< TSource, long > selector)
 Computes the average of a sequence of T:System.Int64 values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? double Average< TSource > (this IEnumerable< TSource > source, Func< TSource, long?> selector)
 Computes the average of a sequence of nullable T:System.Int64 values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static float Average< TSource > (this IEnumerable< TSource > source, Func< TSource, float > selector)
 Computes the average of a sequence of T:System.Single values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? float Average< TSource > (this IEnumerable< TSource > source, Func< TSource, float?> selector)
 Computes the average of a sequence of nullable T:System.Single values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static double Average< TSource > (this IEnumerable< TSource > source, Func< TSource, double > selector)
 Computes the average of a sequence of T:System.Double values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? double Average< TSource > (this IEnumerable< TSource > source, Func< TSource, double?> selector)
 Computes the average of a sequence of nullable T:System.Double values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static decimal Average< TSource > (this IEnumerable< TSource > source, Func< TSource, decimal > selector)
 Computes the average of a sequence of T:System.Decimal values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static ? decimal Average< TSource > (this IEnumerable< TSource > source, Func< TSource, decimal?> selector)
 Computes the average of a sequence of nullable T:System.Decimal values that are obtained by invoking a transform function on each element of the input sequence. More...
 
static IEnumerable< TSource > Append< TSource > (this IEnumerable< TSource > source, TSource element)
 Appends a value to the end of the sequence. More...
 
static IEnumerable< TSource > Prepend< TSource > (this IEnumerable< TSource > source, TSource element)
 Adds a value to the beginning of the sequence. More...
 

Detailed Description

Provides a set of static (Shared in Visual Basic) methods for querying objects that implement T:System.Collections.Generic.IEnumerable`1.

Definition at line 9 of file Enumerable.cs.

Member Function Documentation

◆ Aggregate< TSource >()

static TSource System.Linq.Enumerable.Aggregate< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, TSource, TSource >  func 
)
static

Applies an accumulator function over a sequence.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to aggregate over.
funcAn accumulator function to be invoked on each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The final accumulator value.
Exceptions
T:System.ArgumentNullExceptionsource or func is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 3392 of file Enumerable.cs.

◆ Aggregate< TSource, TAccumulate >()

static TAccumulate System.Linq.Enumerable.Aggregate< TSource, TAccumulate > ( this IEnumerable< TSource >  source,
TAccumulate  seed,
Func< TAccumulate, TSource, TAccumulate >  func 
)
static

Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to aggregate over.
seedThe initial accumulator value.
funcAn accumulator function to be invoked on each element.
Template Parameters
TSourceThe type of the elements of source .
TAccumulateThe type of the accumulator value.
Returns
The final accumulator value.
Exceptions
T:System.ArgumentNullExceptionsource or func is null.

Definition at line 3427 of file Enumerable.cs.

◆ Aggregate< TSource, TAccumulate, TResult >()

static TResult System.Linq.Enumerable.Aggregate< TSource, TAccumulate, TResult > ( this IEnumerable< TSource >  source,
TAccumulate  seed,
Func< TAccumulate, TSource, TAccumulate >  func,
Func< TAccumulate, TResult >  resultSelector 
)
static

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.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to aggregate over.
seedThe initial accumulator value.
funcAn accumulator function to be invoked on each element.
resultSelectorA function to transform the final accumulator value into the result value.
Template Parameters
TSourceThe type of the elements of source .
TAccumulateThe type of the accumulator value.
TResultThe type of the resulting value.
Returns
The transformed final accumulator value.
Exceptions
T:System.ArgumentNullExceptionsource or func or resultSelector is null.

Definition at line 3457 of file Enumerable.cs.

◆ All< TSource >()

static bool System.Linq.Enumerable.All< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Determines whether all elements of a sequence satisfy a condition.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 that contains the elements to apply the predicate to.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 3198 of file Enumerable.cs.

◆ Any< TSource >() [1/2]

static bool System.Linq.Enumerable.Any< TSource > ( this IEnumerable< TSource >  source)
static

Determines whether a sequence contains any elements.

Parameters
sourceThe T:System.Collections.Generic.IEnumerable`1 to check for emptiness.
Template Parameters
TSourceThe type of the elements of source .
Returns
true if the source sequence contains any elements; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3144 of file Enumerable.cs.

◆ Any< TSource >() [2/2]

static bool System.Linq.Enumerable.Any< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Determines whether any element of a sequence satisfies a condition.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 whose elements to apply the predicate to.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
true if any elements in the source sequence pass the test in the specified predicate; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 3169 of file Enumerable.cs.

◆ Append< TSource >()

static IEnumerable<TSource> System.Linq.Enumerable.Append< TSource > ( this IEnumerable< TSource >  source,
TSource  element 
)
static

Appends a value to the end of the sequence.

Parameters
sourceA sequence of values.
elementThe value to append to source .
Template Parameters
TSourceThe type of the elements of source .
Returns
A new sequence that ends with element .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 5302 of file Enumerable.cs.

◆ AsEnumerable< TSource >()

static IEnumerable<TSource> System.Linq.Enumerable.AsEnumerable< TSource > ( this IEnumerable< TSource >  source)
static

Returns the input typed as T:System.Collections.Generic.IEnumerable`1.

Parameters
sourceThe sequence to type as T:System.Collections.Generic.IEnumerable`1.
Template Parameters
TSourceThe type of the elements of source .
Returns
The input sequence typed as T:System.Collections.Generic.IEnumerable`1.

Definition at line 2258 of file Enumerable.cs.

◆ Average() [1/10]

static double System.Linq.Enumerable.Average ( this IEnumerable< int >  source)
static

Computes the average of a sequence of T:System.Int32 values.

Parameters
sourceA sequence of T:System.Int32 values to calculate the average of.
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4860 of file Enumerable.cs.

◆ Average() [2/10]

static ? double System.Linq.Enumerable.Average ( this IEnumerable< int?>  source)
static

Computes the average of a sequence of nullable T:System.Int32 values.

Parameters
sourceA sequence of nullable T:System.Int32 values to calculate the average of.
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe sum of the elements in the sequence is larger than F:System.Int64.MaxValue.

Definition at line 4890 of file Enumerable.cs.

◆ Average() [3/10]

static double System.Linq.Enumerable.Average ( this IEnumerable< long >  source)
static

Computes the average of a sequence of T:System.Int64 values.

Parameters
sourceA sequence of T:System.Int64 values to calculate the average of.
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4924 of file Enumerable.cs.

◆ Average() [4/10]

static ? double System.Linq.Enumerable.Average ( this IEnumerable< long?>  source)
static

Computes the average of a sequence of nullable T:System.Int64 values.

Parameters
sourceA sequence of nullable T:System.Int64 values to calculate the average of.
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe sum of the elements in the sequence is larger than F:System.Int64.MaxValue.

Definition at line 4954 of file Enumerable.cs.

◆ Average() [5/10]

static float System.Linq.Enumerable.Average ( this IEnumerable< float >  source)
static

Computes the average of a sequence of T:System.Single values.

Parameters
sourceA sequence of T:System.Single values to calculate the average of.
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4988 of file Enumerable.cs.

◆ Average() [6/10]

static ? float System.Linq.Enumerable.Average ( this IEnumerable< float?>  source)
static

Computes the average of a sequence of nullable T:System.Single values.

Parameters
sourceA sequence of nullable T:System.Single values to calculate the average of.
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 5014 of file Enumerable.cs.

◆ Average() [7/10]

static double System.Linq.Enumerable.Average ( this IEnumerable< double >  source)
static

Computes the average of a sequence of T:System.Double values.

Parameters
sourceA sequence of T:System.Double values to calculate the average of.
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 5045 of file Enumerable.cs.

◆ Average() [8/10]

static ? double System.Linq.Enumerable.Average ( this IEnumerable< double?>  source)
static

Computes the average of a sequence of nullable T:System.Double values.

Parameters
sourceA sequence of nullable T:System.Double values to calculate the average of.
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 5071 of file Enumerable.cs.

◆ Average() [9/10]

static decimal System.Linq.Enumerable.Average ( this IEnumerable< decimal >  source)
static

Computes the average of a sequence of T:System.Decimal values.

Parameters
sourceA sequence of T:System.Decimal values to calculate the average of.
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 5102 of file Enumerable.cs.

◆ Average() [10/10]

static ? decimal System.Linq.Enumerable.Average ( this IEnumerable< decimal?>  source)
static

Computes the average of a sequence of nullable T:System.Decimal values.

Parameters
sourceA sequence of nullable T:System.Decimal values to calculate the average of.
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe sum of the elements in the sequence is larger than F:System.Decimal.MaxValue.

Definition at line 5129 of file Enumerable.cs.

◆ Average< TSource >() [1/10]

static double System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int >  selector 
)
static

Computes the average of a sequence of T:System.Int32 values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values to calculate the average of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.
T:System.OverflowExceptionThe sum of the elements in the sequence is larger than F:System.Int64.MaxValue.

Definition at line 5163 of file Enumerable.cs.

◆ Average< TSource >() [2/10]

static ? double System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int?>  selector 
)
static

Computes the average of a sequence of nullable T:System.Int32 values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values to calculate the average of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.OverflowExceptionThe sum of the elements in the sequence is larger than F:System.Int64.MaxValue.

Definition at line 5177 of file Enumerable.cs.

◆ Average< TSource >() [3/10]

static double System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, long >  selector 
)
static

Computes the average of a sequence of T:System.Int64 values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values to calculate the average of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source.
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.
T:System.OverflowExceptionThe sum of the elements in the sequence is larger than F:System.Int64.MaxValue.

Definition at line 5193 of file Enumerable.cs.

◆ Average< TSource >() [4/10]

static ? double System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, long?>  selector 
)
static

Computes the average of a sequence of nullable T:System.Int64 values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values to calculate the average of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.

Definition at line 5204 of file Enumerable.cs.

◆ Average< TSource >() [5/10]

static float System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, float >  selector 
)
static

Computes the average of a sequence of T:System.Single values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values to calculate the average of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 5219 of file Enumerable.cs.

◆ Average< TSource >() [6/10]

static ? float System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, float?>  selector 
)
static

Computes the average of a sequence of nullable T:System.Single values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values to calculate the average of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 5232 of file Enumerable.cs.

◆ Average< TSource >() [7/10]

static double System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, double >  selector 
)
static

Computes the average of a sequence of T:System.Double values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values to calculate the average of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 5247 of file Enumerable.cs.

◆ Average< TSource >() [8/10]

static ? double System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, double?>  selector 
)
static

Computes the average of a sequence of nullable T:System.Double values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values to calculate the average of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 5260 of file Enumerable.cs.

◆ Average< TSource >() [9/10]

static decimal System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, decimal >  selector 
)
static

Computes the average of a sequence of T:System.Decimal values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate an average.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The average of the sequence of values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.
T:System.OverflowExceptionThe sum of the elements in the sequence is larger than F:System.Decimal.MaxValue.

Definition at line 5276 of file Enumerable.cs.

◆ Average< TSource >() [10/10]

static ? decimal System.Linq.Enumerable.Average< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, decimal?>  selector 
)
static

Computes the average of a sequence of nullable T:System.Decimal values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values to calculate the average of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.OverflowExceptionThe sum of the elements in the sequence is larger than F:System.Decimal.MaxValue.

Definition at line 5290 of file Enumerable.cs.

◆ Cast< TResult >()

static IEnumerable<TResult> System.Linq.Enumerable.Cast< TResult > ( this IEnumerable  source)
static

Casts the elements of an T:System.Collections.IEnumerable to the specified type.

Parameters
sourceThe T:System.Collections.IEnumerable that contains the elements to be cast to type TResult .
Template Parameters
TResultThe type to cast the elements of source to.
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains each element of the source sequence cast to the specified type.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidCastExceptionAn element in the sequence cannot be cast to type TResult .

Definition at line 2529 of file Enumerable.cs.

◆ Concat< TSource >()

static IEnumerable<TSource> System.Linq.Enumerable.Concat< TSource > ( this IEnumerable< TSource >  first,
IEnumerable< TSource >  second 
)
static

Concatenates two sequences.

Parameters
firstThe first sequence to concatenate.
secondThe sequence to concatenate to the first sequence.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains the concatenated elements of the two input sequences.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 1878 of file Enumerable.cs.

◆ Contains< TSource >() [1/2]

static bool System.Linq.Enumerable.Contains< TSource > ( this IEnumerable< TSource >  source,
TSource  value 
)
static

Determines whether a sequence contains a specified element by using the default equality comparer.

Parameters
sourceA sequence in which to locate a value.
valueThe value to locate in the sequence.
Template Parameters
TSourceThe type of the elements of source .
Returns
true if the source sequence contains an element that has the specified value; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3347 of file Enumerable.cs.

◆ Contains< TSource >() [2/2]

static bool System.Linq.Enumerable.Contains< TSource > ( this IEnumerable< TSource >  source,
TSource  value,
IEqualityComparer< TSource >  comparer 
)
static

Determines whether a sequence contains a specified element by using a specified T:System.Collections.Generic.IEqualityComparer`1.

Parameters
sourceA sequence in which to locate a value.
valueThe value to locate in the sequence.
comparerAn equality comparer to compare values.
Template Parameters
TSourceThe type of the elements of source .
Returns
true if the source sequence contains an element that has the specified value; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3362 of file Enumerable.cs.

◆ Count< TSource >() [1/2]

static int System.Linq.Enumerable.Count< TSource > ( this IEnumerable< TSource >  source)
static

Returns the number of elements in a sequence.

Parameters
sourceA sequence that contains elements to be counted.
Template Parameters
TSourceThe type of the elements of source .
Returns
The number of elements in the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe number of elements in source is larger than F:System.Int32.MaxValue.

Definition at line 3226 of file Enumerable.cs.

◆ Count< TSource >() [2/2]

static int System.Linq.Enumerable.Count< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Returns a number that represents how many elements in the specified sequence satisfy a condition.

Parameters
sourceA sequence that contains elements to be tested and counted.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
A number that represents how many elements in the sequence satisfy the condition in the predicate function.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.
T:System.OverflowExceptionThe number of elements in source is larger than F:System.Int32.MaxValue.

Definition at line 3262 of file Enumerable.cs.

◆ DefaultIfEmpty< TSource >() [1/2]

static IEnumerable<TSource> System.Linq.Enumerable.DefaultIfEmpty< TSource > ( this IEnumerable< TSource >  source)
static

Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.

Parameters
sourceThe sequence to return a default value for if it is empty.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 object that contains the default value for the TSource type if source is empty; otherwise, source .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2455 of file Enumerable.cs.

◆ DefaultIfEmpty< TSource >() [2/2]

static IEnumerable<TSource> System.Linq.Enumerable.DefaultIfEmpty< TSource > ( this IEnumerable< TSource >  source,
TSource  defaultValue 
)
static

Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.

Parameters
sourceThe sequence to return the specified value for if it is empty.
defaultValueThe value to return if the sequence is empty.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains defaultValue if source is empty; otherwise, source .

Definition at line 2466 of file Enumerable.cs.

◆ Distinct< TSource >() [1/2]

static IEnumerable<TSource> System.Linq.Enumerable.Distinct< TSource > ( this IEnumerable< TSource >  source)
static

Returns distinct elements from a sequence by using the default equality comparer to compare values.

Parameters
sourceThe sequence to remove duplicate elements from.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains distinct elements from the source sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1952 of file Enumerable.cs.

◆ Distinct< TSource >() [2/2]

static IEnumerable<TSource> System.Linq.Enumerable.Distinct< TSource > ( this IEnumerable< TSource >  source,
IEqualityComparer< TSource >  comparer 
)
static

Returns distinct elements from a sequence by using a specified T:System.Collections.Generic.IEqualityComparer`1 to compare values.

Parameters
sourceThe sequence to remove duplicate elements from.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare values.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains distinct elements from the source sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1969 of file Enumerable.cs.

◆ ElementAt< TSource >()

static TSource System.Linq.Enumerable.ElementAt< TSource > ( this IEnumerable< TSource >  source,
int  index 
)
static

Returns the element at a specified index in a sequence.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return an element from.
indexThe zero-based index of the element to retrieve.
Template Parameters
TSourceThe type of the elements of source .
Returns
The element at the specified position in the source sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionindex is less than 0 or greater than or equal to the number of elements in source .

Definition at line 3004 of file Enumerable.cs.

◆ ElementAtOrDefault< TSource >()

static TSource System.Linq.Enumerable.ElementAtOrDefault< TSource > ( this IEnumerable< TSource >  source,
int  index 
)
static

Returns the element at a specified index in a sequence or a default value if the index is out of range.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return an element from.
indexThe zero-based index of the element to retrieve.
Template Parameters
TSourceThe type of the elements of source .
Returns
default(TSource ) if the index is outside the bounds of the source sequence; otherwise, the element at the specified position in the source sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3042 of file Enumerable.cs.

◆ Empty< TResult >()

static IEnumerable<TResult> System.Linq.Enumerable.Empty< TResult > ( )
static

Returns an empty T:System.Collections.Generic.IEnumerable`1 that has the specified type argument.

Template Parameters
TResultThe type to assign to the type parameter of the returned generic T:System.Collections.Generic.IEnumerable`1.
Returns
An empty T:System.Collections.Generic.IEnumerable`1 whose type argument is TResult .

Definition at line 3131 of file Enumerable.cs.

◆ Except< TSource >() [1/2]

static IEnumerable<TSource> System.Linq.Enumerable.Except< TSource > ( this IEnumerable< TSource >  first,
IEnumerable< TSource >  second 
)
static

Produces the set difference of two sequences by using the default equality comparer to compare values.

Parameters
firstAn T:System.Collections.Generic.IEnumerable`1 whose elements that are not also in second will be returned.
secondAn T:System.Collections.Generic.IEnumerable`1 whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
A sequence that contains the set difference of the elements of two sequences.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 2119 of file Enumerable.cs.

◆ Except< TSource >() [2/2]

static IEnumerable<TSource> System.Linq.Enumerable.Except< TSource > ( this IEnumerable< TSource >  first,
IEnumerable< TSource >  second,
IEqualityComparer< TSource >  comparer 
)
static

Produces the set difference of two sequences by using the specified T:System.Collections.Generic.IEqualityComparer`1 to compare values.

Parameters
firstAn T:System.Collections.Generic.IEnumerable`1 whose elements that are not also in second will be returned.
secondAn T:System.Collections.Generic.IEnumerable`1 whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare values.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
A sequence that contains the set difference of the elements of two sequences.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 2141 of file Enumerable.cs.

◆ First< TSource >() [1/2]

static TSource System.Linq.Enumerable.First< TSource > ( this IEnumerable< TSource >  source)
static

Returns the first element of a sequence.

Parameters
sourceThe T:System.Collections.Generic.IEnumerable`1 to return the first element of.
Template Parameters
TSourceThe type of the elements of source .
Returns
The first element in the specified sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionThe source sequence is empty.

Definition at line 2559 of file Enumerable.cs.

◆ First< TSource >() [2/2]

static TSource System.Linq.Enumerable.First< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Returns the first element in a sequence that satisfies a specified condition.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return an element from.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
The first element in the sequence that passes the test in the specified predicate function.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.
T:System.InvalidOperationExceptionNo element satisfies the condition in predicate .-or-The source sequence is empty.

Definition at line 2595 of file Enumerable.cs.

◆ FirstOrDefault< TSource >() [1/2]

static TSource System.Linq.Enumerable.FirstOrDefault< TSource > ( this IEnumerable< TSource >  source)
static

Returns the first element of a sequence, or a default value if the sequence contains no elements.

Parameters
sourceThe T:System.Collections.Generic.IEnumerable`1 to return the first element of.
Template Parameters
TSourceThe type of the elements of source .
Returns
default(TSource ) if source is empty; otherwise, the first element in source .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2623 of file Enumerable.cs.

◆ FirstOrDefault< TSource >() [2/2]

static TSource System.Linq.Enumerable.FirstOrDefault< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return an element from.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
default(TSource ) if source is empty or if no element passes the test specified by predicate ; otherwise, the first element in source that passes the test specified by predicate .
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 2659 of file Enumerable.cs.

◆ GroupBy< TSource, TKey >() [1/2]

static IEnumerable<IGrouping<TKey, TSource> > System.Linq.Enumerable.GroupBy< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector 
)
static

Groups the elements of a sequence according to a specified key selector function.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 whose elements to group.
keySelectorA function to extract the key for each element.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An IEnumerable<IGrouping<TKey, TSource>> in C# or IEnumerable(Of IGrouping(Of TKey, TSource)) in Visual Basic where each T:System.Linq.IGrouping`2 object contains a sequence of objects and a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1755 of file Enumerable.cs.

◆ GroupBy< TSource, TKey >() [2/2]

static IEnumerable<IGrouping<TKey, TSource> > System.Linq.Enumerable.GroupBy< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
IEqualityComparer< TKey >  comparer 
)
static

Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 whose elements to group.
keySelectorA function to extract the key for each element.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An IEnumerable<IGrouping<TKey, TSource>> in C# or IEnumerable(Of IGrouping(Of TKey, TSource)) in Visual Basic where each T:System.Linq.IGrouping`2 object contains a collection of objects and a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1770 of file Enumerable.cs.

◆ GroupBy< TSource, TKey, TElement >() [1/2]

static IEnumerable<IGrouping<TKey, TElement> > System.Linq.Enumerable.GroupBy< TSource, TKey, TElement > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TSource, TElement >  elementSelector 
)
static

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.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 whose elements to group.
keySelectorA function to extract the key for each element.
elementSelectorA function to map each source element to an element in the T:System.Linq.IGrouping`2.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TElementThe type of the elements in the T:System.Linq.IGrouping`2.
Returns
An IEnumerable<IGrouping<TKey, TElement>> in C# or IEnumerable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each T:System.Linq.IGrouping`2 object contains a collection of objects of type TElement and a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector is null.

Definition at line 1786 of file Enumerable.cs.

◆ GroupBy< TSource, TKey, TElement >() [2/2]

static IEnumerable<IGrouping<TKey, TElement> > System.Linq.Enumerable.GroupBy< TSource, TKey, TElement > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TSource, TElement >  elementSelector,
IEqualityComparer< TKey >  comparer 
)
static

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.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 whose elements to group.
keySelectorA function to extract the key for each element.
elementSelectorA function to map each source element to an element in an T:System.Linq.IGrouping`2.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TElementThe type of the elements in the T:System.Linq.IGrouping`2.
Returns
An IEnumerable<IGrouping<TKey, TElement>> in C# or IEnumerable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each T:System.Linq.IGrouping`2 object contains a collection of objects of type TElement and a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector is null.

Definition at line 1803 of file Enumerable.cs.

◆ GroupBy< TSource, TKey, TElement, TResult >() [1/2]

static IEnumerable<TResult> System.Linq.Enumerable.GroupBy< TSource, TKey, TElement, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TSource, TElement >  elementSelector,
Func< TKey, IEnumerable< TElement >, TResult >  resultSelector 
)
static

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.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 whose elements to group.
keySelectorA function to extract the key for each element.
elementSelectorA function to map each source element to an element in an T:System.Linq.IGrouping`2.
resultSelectorA function to create a result value from each group.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TElementThe type of the elements in each T:System.Linq.IGrouping`2.
TResultThe type of the result value returned by resultSelector .
Returns
A collection of elements of type TResult where each element represents a projection over a group and its key.

Definition at line 1833 of file Enumerable.cs.

◆ GroupBy< TSource, TKey, TElement, TResult >() [2/2]

static IEnumerable<TResult> System.Linq.Enumerable.GroupBy< TSource, TKey, TElement, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TSource, TElement >  elementSelector,
Func< TKey, IEnumerable< TElement >, TResult >  resultSelector,
IEqualityComparer< TKey >  comparer 
)
static

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.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 whose elements to group.
keySelectorA function to extract the key for each element.
elementSelectorA function to map each source element to an element in an T:System.Linq.IGrouping`2.
resultSelectorA function to create a result value from each group.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare keys with.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TElementThe type of the elements in each T:System.Linq.IGrouping`2.
TResultThe type of the result value returned by resultSelector .
Returns
A collection of elements of type TResult where each element represents a projection over a group and its key.

Definition at line 1865 of file Enumerable.cs.

◆ GroupBy< TSource, TKey, TResult >() [1/2]

static IEnumerable<TResult> System.Linq.Enumerable.GroupBy< TSource, TKey, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TKey, IEnumerable< TSource >, TResult >  resultSelector 
)
static

Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 whose elements to group.
keySelectorA function to extract the key for each element.
resultSelectorA function to create a result value from each group.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TResultThe type of the result value returned by resultSelector .
Returns
A collection of elements of type TResult where each element represents a projection over a group and its key.

Definition at line 1817 of file Enumerable.cs.

◆ GroupBy< TSource, TKey, TResult >() [2/2]

static IEnumerable<TResult> System.Linq.Enumerable.GroupBy< TSource, TKey, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TKey, IEnumerable< TSource >, TResult >  resultSelector,
IEqualityComparer< TKey >  comparer 
)
static

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.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 whose elements to group.
keySelectorA function to extract the key for each element.
resultSelectorA function to create a result value from each group.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare keys with.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TResultThe type of the result value returned by resultSelector .
Returns
A collection of elements of type TResult where each element represents a projection over a group and its key.

Definition at line 1848 of file Enumerable.cs.

◆ GroupJoin< TOuter, TInner, TKey, TResult >() [1/2]

static IEnumerable<TResult> System.Linq.Enumerable.GroupJoin< TOuter, TInner, TKey, TResult > ( this IEnumerable< TOuter >  outer,
IEnumerable< TInner >  inner,
Func< TOuter, TKey >  outerKeySelector,
Func< TInner, TKey >  innerKeySelector,
Func< TOuter, IEnumerable< TInner >, TResult >  resultSelector 
)
static

Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys.

Parameters
outerThe first sequence to join.
innerThe sequence to join to the first sequence.
outerKeySelectorA function to extract the join key from each element of the first sequence.
innerKeySelectorA function to extract the join key from each element of the second sequence.
resultSelectorA function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.
Template Parameters
TOuterThe type of the elements of the first sequence.
TInnerThe type of the elements of the second sequence.
TKeyThe type of the keys returned by the key selector functions.
TResultThe type of the result elements.
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains elements of type TResult that are obtained by performing a grouped join on two sequences.
Exceptions
T:System.ArgumentNullExceptionouter or inner or outerKeySelector or innerKeySelector or resultSelector is null.

Definition at line 1540 of file Enumerable.cs.

◆ GroupJoin< TOuter, TInner, TKey, TResult >() [2/2]

static IEnumerable<TResult> System.Linq.Enumerable.GroupJoin< TOuter, TInner, TKey, TResult > ( this IEnumerable< TOuter >  outer,
IEnumerable< TInner >  inner,
Func< TOuter, TKey >  outerKeySelector,
Func< TInner, TKey >  innerKeySelector,
Func< TOuter, IEnumerable< TInner >, TResult >  resultSelector,
IEqualityComparer< TKey >  comparer 
)
static

Correlates the elements of two sequences based on key equality and groups the results. A specified T:System.Collections.Generic.IEqualityComparer`1 is used to compare keys.

Parameters
outerThe first sequence to join.
innerThe sequence to join to the first sequence.
outerKeySelectorA function to extract the join key from each element of the first sequence.
innerKeySelectorA function to extract the join key from each element of the second sequence.
resultSelectorA function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to hash and compare keys.
Template Parameters
TOuterThe type of the elements of the first sequence.
TInnerThe type of the elements of the second sequence.
TKeyThe type of the keys returned by the key selector functions.
TResultThe type of the result elements.
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains elements of type TResult that are obtained by performing a grouped join on two sequences.
Exceptions
T:System.ArgumentNullExceptionouter or inner or outerKeySelector or innerKeySelector or resultSelector is null.

Definition at line 1580 of file Enumerable.cs.

◆ Intersect< TSource >() [1/2]

static IEnumerable<TSource> System.Linq.Enumerable.Intersect< TSource > ( this IEnumerable< TSource >  first,
IEnumerable< TSource >  second 
)
static

Produces the set intersection of two sequences by using the default equality comparer to compare values.

Parameters
firstAn T:System.Collections.Generic.IEnumerable`1 whose distinct elements that also appear in second will be returned.
secondAn T:System.Collections.Generic.IEnumerable`1 whose distinct elements that also appear in the first sequence will be returned.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
A sequence that contains the elements that form the set intersection of two sequences.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 2060 of file Enumerable.cs.

◆ Intersect< TSource >() [2/2]

static IEnumerable<TSource> System.Linq.Enumerable.Intersect< TSource > ( this IEnumerable< TSource >  first,
IEnumerable< TSource >  second,
IEqualityComparer< TSource >  comparer 
)
static

Produces the set intersection of two sequences by using the specified T:System.Collections.Generic.IEqualityComparer`1 to compare values.

Parameters
firstAn T:System.Collections.Generic.IEnumerable`1 whose distinct elements that also appear in second will be returned.
secondAn T:System.Collections.Generic.IEnumerable`1 whose distinct elements that also appear in the first sequence will be returned.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare values.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
A sequence that contains the elements that form the set intersection of two sequences.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 2082 of file Enumerable.cs.

◆ Join< TOuter, TInner, TKey, TResult >() [1/2]

static IEnumerable<TResult> System.Linq.Enumerable.Join< TOuter, TInner, TKey, TResult > ( this IEnumerable< TOuter >  outer,
IEnumerable< TInner >  inner,
Func< TOuter, TKey >  outerKeySelector,
Func< TInner, TKey >  innerKeySelector,
Func< TOuter, TInner, TResult >  resultSelector 
)
static

Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.

Parameters
outerThe first sequence to join.
innerThe sequence to join to the first sequence.
outerKeySelectorA function to extract the join key from each element of the first sequence.
innerKeySelectorA function to extract the join key from each element of the second sequence.
resultSelectorA function to create a result element from two matching elements.
Template Parameters
TOuterThe type of the elements of the first sequence.
TInnerThe type of the elements of the second sequence.
TKeyThe type of the keys returned by the key selector functions.
TResultThe type of the result elements.
Returns
An T:System.Collections.Generic.IEnumerable`1 that has elements of type TResult that are obtained by performing an inner join on two sequences.
Exceptions
T:System.ArgumentNullExceptionouter or inner or outerKeySelector or innerKeySelector or resultSelector is null.

Definition at line 1445 of file Enumerable.cs.

◆ Join< TOuter, TInner, TKey, TResult >() [2/2]

static IEnumerable<TResult> System.Linq.Enumerable.Join< TOuter, TInner, TKey, TResult > ( this IEnumerable< TOuter >  outer,
IEnumerable< TInner >  inner,
Func< TOuter, TKey >  outerKeySelector,
Func< TInner, TKey >  innerKeySelector,
Func< TOuter, TInner, TResult >  resultSelector,
IEqualityComparer< TKey >  comparer 
)
static

Correlates the elements of two sequences based on matching keys. A specified T:System.Collections.Generic.IEqualityComparer`1 is used to compare keys.

Parameters
outerThe first sequence to join.
innerThe sequence to join to the first sequence.
outerKeySelectorA function to extract the join key from each element of the first sequence.
innerKeySelectorA function to extract the join key from each element of the second sequence.
resultSelectorA function to create a result element from two matching elements.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to hash and compare keys.
Template Parameters
TOuterThe type of the elements of the first sequence.
TInnerThe type of the elements of the second sequence.
TKeyThe type of the keys returned by the key selector functions.
TResultThe type of the result elements.
Returns
An T:System.Collections.Generic.IEnumerable`1 that has elements of type TResult that are obtained by performing an inner join on two sequences.
Exceptions
T:System.ArgumentNullExceptionouter or inner or outerKeySelector or innerKeySelector or resultSelector is null.

Definition at line 1485 of file Enumerable.cs.

◆ Last< TSource >() [1/2]

static TSource System.Linq.Enumerable.Last< TSource > ( this IEnumerable< TSource >  source)
static

Returns the last element of a sequence.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return the last element of.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value at the last position in the source sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionThe source sequence is empty.

Definition at line 2687 of file Enumerable.cs.

◆ Last< TSource >() [2/2]

static TSource System.Linq.Enumerable.Last< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Returns the last element of a sequence that satisfies a specified condition.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return an element from.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
The last element in the sequence that passes the test in the specified predicate function.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.
T:System.InvalidOperationExceptionNo element satisfies the condition in predicate .-or-The source sequence is empty.

Definition at line 2730 of file Enumerable.cs.

◆ LastOrDefault< TSource >() [1/2]

static TSource System.Linq.Enumerable.LastOrDefault< TSource > ( this IEnumerable< TSource >  source)
static

Returns the last element of a sequence, or a default value if the sequence contains no elements.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return the last element of.
Template Parameters
TSourceThe type of the elements of source .
Returns
default(TSource ) if the source sequence is empty; otherwise, the last element in the T:System.Collections.Generic.IEnumerable`1.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2765 of file Enumerable.cs.

◆ LastOrDefault< TSource >() [2/2]

static TSource System.Linq.Enumerable.LastOrDefault< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return an element from.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
default(TSource ) if the sequence is empty or if no elements pass the test in the predicate function; otherwise, the last element that passes the test in the predicate function.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 2808 of file Enumerable.cs.

◆ LongCount< TSource >() [1/2]

static long System.Linq.Enumerable.LongCount< TSource > ( this IEnumerable< TSource >  source)
static

Returns an T:System.Int64 that represents the total number of elements in a sequence.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 that contains the elements to be counted.
Template Parameters
TSourceThe type of the elements of source .
Returns
The number of elements in the source sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe number of elements exceeds F:System.Int64.MaxValue.

Definition at line 3291 of file Enumerable.cs.

◆ LongCount< TSource >() [2/2]

static long System.Linq.Enumerable.LongCount< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Returns an T:System.Int64 that represents how many elements in a sequence satisfy a condition.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 that contains the elements to be counted.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
A number that represents how many elements in the sequence satisfy the condition in the predicate function.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.
T:System.OverflowExceptionThe number of matching elements exceeds F:System.Int64.MaxValue.

Definition at line 3317 of file Enumerable.cs.

◆ Max() [1/10]

static int System.Linq.Enumerable.Max ( this IEnumerable< int >  source)
static

Returns the maximum value in a sequence of T:System.Int32 values.

Parameters
sourceA sequence of T:System.Int32 values to determine the maximum value of.
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4352 of file Enumerable.cs.

◆ Max() [2/10]

static ? int System.Linq.Enumerable.Max ( this IEnumerable< int?>  source)
static

Returns the maximum value in a sequence of nullable T:System.Int32 values.

Parameters
sourceA sequence of nullable T:System.Int32 values to determine the maximum value of.
Returns
A value of type Nullable<Int32> in C# or Nullable(Of Int32) in Visual Basic that corresponds to the maximum value in the sequence. 
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4388 of file Enumerable.cs.

◆ Max() [3/10]

static long System.Linq.Enumerable.Max ( this IEnumerable< long >  source)
static

Returns the maximum value in a sequence of T:System.Int64 values.

Parameters
sourceA sequence of T:System.Int64 values to determine the maximum value of.
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4413 of file Enumerable.cs.

◆ Max() [4/10]

static ? long System.Linq.Enumerable.Max ( this IEnumerable< long?>  source)
static

Returns the maximum value in a sequence of nullable T:System.Int64 values.

Parameters
sourceA sequence of nullable T:System.Int64 values to determine the maximum value of.
Returns
A value of type Nullable<Int64> in C# or Nullable(Of Int64) in Visual Basic that corresponds to the maximum value in the sequence. 
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4449 of file Enumerable.cs.

◆ Max() [5/10]

static double System.Linq.Enumerable.Max ( this IEnumerable< double >  source)
static

Returns the maximum value in a sequence of T:System.Double values.

Parameters
sourceA sequence of T:System.Double values to determine the maximum value of.
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4474 of file Enumerable.cs.

◆ Max() [6/10]

static ? double System.Linq.Enumerable.Max ( this IEnumerable< double?>  source)
static

Returns the maximum value in a sequence of nullable T:System.Double values.

Parameters
sourceA sequence of nullable T:System.Double values to determine the maximum value of.
Returns
A value of type Nullable<Double> in C# or Nullable(Of Double) in Visual Basic that corresponds to the maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4510 of file Enumerable.cs.

◆ Max() [7/10]

static float System.Linq.Enumerable.Max ( this IEnumerable< float >  source)
static

Returns the maximum value in a sequence of T:System.Single values.

Parameters
sourceA sequence of T:System.Single values to determine the maximum value of.
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4535 of file Enumerable.cs.

◆ Max() [8/10]

static ? float System.Linq.Enumerable.Max ( this IEnumerable< float?>  source)
static

Returns the maximum value in a sequence of nullable T:System.Single values.

Parameters
sourceA sequence of nullable T:System.Single values to determine the maximum value of.
Returns
A value of type Nullable<Single> in C# or Nullable(Of Single) in Visual Basic that corresponds to the maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4571 of file Enumerable.cs.

◆ Max() [9/10]

static decimal System.Linq.Enumerable.Max ( this IEnumerable< decimal >  source)
static

Returns the maximum value in a sequence of T:System.Decimal values.

Parameters
sourceA sequence of T:System.Decimal values to determine the maximum value of.
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4596 of file Enumerable.cs.

◆ Max() [10/10]

static ? decimal System.Linq.Enumerable.Max ( this IEnumerable< decimal?>  source)
static

Returns the maximum value in a sequence of nullable T:System.Decimal values.

Parameters
sourceA sequence of nullable T:System.Decimal values to determine the maximum value of.
Returns
A value of type Nullable<Decimal> in C# or Nullable(Of Decimal) in Visual Basic that corresponds to the maximum value in the sequence. 
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4632 of file Enumerable.cs.

◆ Max< TSource >() [1/11]

static TSource System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source)
static

Returns the maximum value in a generic sequence.

Parameters
sourceA sequence of values to determine the maximum value of.
Template Parameters
TSourceThe type of the elements of source .
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4656 of file Enumerable.cs.

◆ Max< TSource >() [2/11]

static int System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum T:System.Int32 value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4708 of file Enumerable.cs.

◆ Max< TSource >() [3/11]

static ? int System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Int32 value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Int32> in C# or Nullable(Of Int32) in Visual Basic that corresponds to the maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4721 of file Enumerable.cs.

◆ Max< TSource >() [4/11]

static long System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, long >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum T:System.Int64 value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4736 of file Enumerable.cs.

◆ Max< TSource >() [5/11]

static ? long System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, long?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Int64 value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Int64> in C# or Nullable(Of Int64) in Visual Basic that corresponds to the maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4749 of file Enumerable.cs.

◆ Max< TSource >() [6/11]

static float System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, float >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum T:System.Single value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4764 of file Enumerable.cs.

◆ Max< TSource >() [7/11]

static ? float System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, float?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Single value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Single> in C# or Nullable(Of Single) in Visual Basic that corresponds to the maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4777 of file Enumerable.cs.

◆ Max< TSource >() [8/11]

static double System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, double >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum T:System.Double value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4792 of file Enumerable.cs.

◆ Max< TSource >() [9/11]

static ? double System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, double?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Double value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Double> in C# or Nullable(Of Double) in Visual Basic that corresponds to the maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4805 of file Enumerable.cs.

◆ Max< TSource >() [10/11]

static decimal System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, decimal >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum T:System.Decimal value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4820 of file Enumerable.cs.

◆ Max< TSource >() [11/11]

static ? decimal System.Linq.Enumerable.Max< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, decimal?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the maximum nullable T:System.Decimal value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Decimal> in C# or Nullable(Of Decimal) in Visual Basic that corresponds to the maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4833 of file Enumerable.cs.

◆ Max< TSource, TResult >()

static TResult System.Linq.Enumerable.Max< TSource, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, TResult >  selector 
)
static

Invokes a transform function on each element of a generic sequence and returns the maximum resulting value.

Parameters
sourceA sequence of values to determine the maximum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
TResultThe type of the value returned by selector .
Returns
The maximum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4847 of file Enumerable.cs.

◆ Min() [1/10]

static int System.Linq.Enumerable.Min ( this IEnumerable< int >  source)
static

Returns the minimum value in a sequence of T:System.Int32 values.

Parameters
sourceA sequence of T:System.Int32 values to determine the minimum value of.
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 3844 of file Enumerable.cs.

◆ Min() [2/10]

static ? int System.Linq.Enumerable.Min ( this IEnumerable< int?>  source)
static

Returns the minimum value in a sequence of nullable T:System.Int32 values.

Parameters
sourceA sequence of nullable T:System.Int32 values to determine the minimum value of.
Returns
A value of type Nullable<Int32> in C# or Nullable(Of Int32) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3880 of file Enumerable.cs.

◆ Min() [3/10]

static long System.Linq.Enumerable.Min ( this IEnumerable< long >  source)
static

Returns the minimum value in a sequence of T:System.Int64 values.

Parameters
sourceA sequence of T:System.Int64 values to determine the minimum value of.
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 3905 of file Enumerable.cs.

◆ Min() [4/10]

static ? long System.Linq.Enumerable.Min ( this IEnumerable< long?>  source)
static

Returns the minimum value in a sequence of nullable T:System.Int64 values.

Parameters
sourceA sequence of nullable T:System.Int64 values to determine the minimum value of.
Returns
A value of type Nullable<Int64> in C# or Nullable(Of Int64) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3941 of file Enumerable.cs.

◆ Min() [5/10]

static float System.Linq.Enumerable.Min ( this IEnumerable< float >  source)
static

Returns the minimum value in a sequence of T:System.Single values.

Parameters
sourceA sequence of T:System.Single values to determine the minimum value of.
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 3966 of file Enumerable.cs.

◆ Min() [6/10]

static ? float System.Linq.Enumerable.Min ( this IEnumerable< float?>  source)
static

Returns the minimum value in a sequence of nullable T:System.Single values.

Parameters
sourceA sequence of nullable T:System.Single values to determine the minimum value of.
Returns
A value of type Nullable<Single> in C# or Nullable(Of Single) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4002 of file Enumerable.cs.

◆ Min() [7/10]

static double System.Linq.Enumerable.Min ( this IEnumerable< double >  source)
static

Returns the minimum value in a sequence of T:System.Double values.

Parameters
sourceA sequence of T:System.Double values to determine the minimum value of.
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4027 of file Enumerable.cs.

◆ Min() [8/10]

static ? double System.Linq.Enumerable.Min ( this IEnumerable< double?>  source)
static

Returns the minimum value in a sequence of nullable T:System.Double values.

Parameters
sourceA sequence of nullable T:System.Double values to determine the minimum value of.
Returns
A value of type Nullable<Double> in C# or Nullable(Of Double) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4063 of file Enumerable.cs.

◆ Min() [9/10]

static decimal System.Linq.Enumerable.Min ( this IEnumerable< decimal >  source)
static

Returns the minimum value in a sequence of T:System.Decimal values.

Parameters
sourceA sequence of T:System.Decimal values to determine the minimum value of.
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4088 of file Enumerable.cs.

◆ Min() [10/10]

static ? decimal System.Linq.Enumerable.Min ( this IEnumerable< decimal?>  source)
static

Returns the minimum value in a sequence of nullable T:System.Decimal values.

Parameters
sourceA sequence of nullable T:System.Decimal values to determine the minimum value of.
Returns
A value of type Nullable<Decimal> in C# or Nullable(Of Decimal) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4124 of file Enumerable.cs.

◆ Min< TSource >() [1/11]

static TSource System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source)
static

Returns the minimum value in a generic sequence.

Parameters
sourceA sequence of values to determine the minimum value of.
Template Parameters
TSourceThe type of the elements of source .
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 4148 of file Enumerable.cs.

◆ Min< TSource >() [2/11]

static int System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum T:System.Int32 value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4200 of file Enumerable.cs.

◆ Min< TSource >() [3/11]

static ? int System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Int32 value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Int32> in C# or Nullable(Of Int32) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4213 of file Enumerable.cs.

◆ Min< TSource >() [4/11]

static long System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, long >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum T:System.Int64 value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4228 of file Enumerable.cs.

◆ Min< TSource >() [5/11]

static ? long System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, long?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Int64 value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Int64> in C# or Nullable(Of Int64) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4241 of file Enumerable.cs.

◆ Min< TSource >() [6/11]

static float System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, float >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum T:System.Single value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4256 of file Enumerable.cs.

◆ Min< TSource >() [7/11]

static ? float System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, float?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Single value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Single> in C# or Nullable(Of Single) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4269 of file Enumerable.cs.

◆ Min< TSource >() [8/11]

static double System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, double >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum T:System.Double value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4284 of file Enumerable.cs.

◆ Min< TSource >() [9/11]

static ? double System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, double?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Double value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Double> in C# or Nullable(Of Double) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4297 of file Enumerable.cs.

◆ Min< TSource >() [10/11]

static decimal System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, decimal >  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum T:System.Decimal value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.InvalidOperationExceptionsource contains no elements.

Definition at line 4312 of file Enumerable.cs.

◆ Min< TSource >() [11/11]

static ? decimal System.Linq.Enumerable.Min< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, decimal?>  selector 
)
static

Invokes a transform function on each element of a sequence and returns the minimum nullable T:System.Decimal value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The value of type Nullable<Decimal> in C# or Nullable(Of Decimal) in Visual Basic that corresponds to the minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4325 of file Enumerable.cs.

◆ Min< TSource, TResult >()

static TResult System.Linq.Enumerable.Min< TSource, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, TResult >  selector 
)
static

Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.

Parameters
sourceA sequence of values to determine the minimum value of.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
TResultThe type of the value returned by selector .
Returns
The minimum value in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 4339 of file Enumerable.cs.

◆ OfType< TResult >()

static IEnumerable<TResult> System.Linq.Enumerable.OfType< TResult > ( this IEnumerable  source)
static

Filters the elements of an T:System.Collections.IEnumerable based on a specified type.

Parameters
sourceThe T:System.Collections.IEnumerable whose elements to filter.
Template Parameters
TResultThe type to filter the elements of the sequence on.
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains elements from the input sequence of type TResult .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2501 of file Enumerable.cs.

◆ OrderBy< TSource, TKey >() [1/2]

static IOrderedEnumerable<TSource> System.Linq.Enumerable.OrderBy< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector 
)
static

Sorts the elements of a sequence in ascending order according to a key.

Parameters
sourceA sequence of values to order.
keySelectorA function to extract a key from an element.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An T:System.Linq.IOrderedEnumerable`1 whose elements are sorted according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1623 of file Enumerable.cs.

◆ OrderBy< TSource, TKey >() [2/2]

static IOrderedEnumerable<TSource> System.Linq.Enumerable.OrderBy< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
IComparer< TKey >  comparer 
)
static

Sorts the elements of a sequence in ascending order by using a specified comparer.

Parameters
sourceA sequence of values to order.
keySelectorA function to extract a key from an element.
comparerAn T:System.Collections.Generic.IComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An T:System.Linq.IOrderedEnumerable`1 whose elements are sorted according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1638 of file Enumerable.cs.

◆ OrderByDescending< TSource, TKey >() [1/2]

static IOrderedEnumerable<TSource> System.Linq.Enumerable.OrderByDescending< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector 
)
static

Sorts the elements of a sequence in descending order according to a key.

Parameters
sourceA sequence of values to order.
keySelectorA function to extract a key from an element.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An T:System.Linq.IOrderedEnumerable`1 whose elements are sorted in descending order according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1652 of file Enumerable.cs.

◆ OrderByDescending< TSource, TKey >() [2/2]

static IOrderedEnumerable<TSource> System.Linq.Enumerable.OrderByDescending< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
IComparer< TKey >  comparer 
)
static

Sorts the elements of a sequence in descending order by using a specified comparer.

Parameters
sourceA sequence of values to order.
keySelectorA function to extract a key from an element.
comparerAn T:System.Collections.Generic.IComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An T:System.Linq.IOrderedEnumerable`1 whose elements are sorted in descending order according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1667 of file Enumerable.cs.

◆ Prepend< TSource >()

static IEnumerable<TSource> System.Linq.Enumerable.Prepend< TSource > ( this IEnumerable< TSource >  source,
TSource  element 
)
static

Adds a value to the beginning of the sequence.

Parameters
sourceA sequence of values.
elementThe value to prepend to source .
Template Parameters
TSourceThe type of the elements of source .
Returns
A new sequence that begins with element .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 5323 of file Enumerable.cs.

◆ Range()

static IEnumerable<int> System.Linq.Enumerable.Range ( int  start,
int  count 
)
static

Generates a sequence of integral numbers within a specified range.

Parameters
startThe value of the first integer in the sequence.
countThe number of sequential integers to generate.
Returns
An IEnumerable<Int32> in C# or IEnumerable(Of Int32) in Visual Basic that contains a range of sequential integral numbers.
Exceptions
T:System.ArgumentOutOfRangeExceptioncount is less than 0.-or- start + count -1 is larger than F:System.Int32.MaxValue.

Definition at line 3084 of file Enumerable.cs.

◆ Repeat< TResult >()

static IEnumerable<TResult> System.Linq.Enumerable.Repeat< TResult > ( TResult  element,
int  count 
)
static

Generates a sequence that contains one repeated value.

Parameters
elementThe value to be repeated.
countThe number of times to repeat the value in the generated sequence.
Template Parameters
TResultThe type of the value to be repeated in the result sequence.
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains a repeated value.
Exceptions
T:System.ArgumentOutOfRangeExceptioncount is less than 0.

Definition at line 3110 of file Enumerable.cs.

◆ Reverse< TSource >()

static IEnumerable<TSource> System.Linq.Enumerable.Reverse< TSource > ( this IEnumerable< TSource >  source)
static

Inverts the order of the elements in a sequence.

Parameters
sourceA sequence of values to reverse.
Template Parameters
TSourceThe type of the elements of source .
Returns
A sequence whose elements correspond to those of the input sequence in reverse order.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2177 of file Enumerable.cs.

◆ Select< TSource, TResult >() [1/2]

static IEnumerable<TResult> System.Linq.Enumerable.Select< TSource, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, TResult >  selector 
)
static

Projects each element of a sequence into a new form.

Parameters
sourceA sequence of values to invoke a transform function on.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
TResultThe type of the value returned by selector .
Returns
An T:System.Collections.Generic.IEnumerable`1 whose elements are the result of invoking the transform function on each element of source .
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 996 of file Enumerable.cs.

◆ Select< TSource, TResult >() [2/2]

static IEnumerable<TResult> System.Linq.Enumerable.Select< TSource, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, int, TResult >  selector 
)
static

Projects each element of a sequence into a new form by incorporating the element's index.

Parameters
sourceA sequence of values to invoke a transform function on.
selectorA transform function to apply to each source element; the second parameter of the function represents the index of the source element.
Template Parameters
TSourceThe type of the elements of source .
TResultThe type of the value returned by selector .
Returns
An T:System.Collections.Generic.IEnumerable`1 whose elements are the result of invoking the transform function on each element of source .
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 1030 of file Enumerable.cs.

◆ SelectMany< TSource, TCollection, TResult >() [1/2]

static IEnumerable<TResult> System.Linq.Enumerable.SelectMany< TSource, TCollection, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, int, IEnumerable< TCollection >>  collectionSelector,
Func< TSource, TCollection, TResult >  resultSelector 
)
static

Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1, 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.

Parameters
sourceA sequence of values to project.
collectionSelectorA transform function to apply to each source element; the second parameter of the function represents the index of the source element.
resultSelectorA transform function to apply to each element of the intermediate sequence.
Template Parameters
TSourceThe type of the elements of source .
TCollectionThe type of the intermediate elements collected by collectionSelector .
TResultThe type of the elements of the resulting sequence.
Returns
An T:System.Collections.Generic.IEnumerable`1 whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of source and then mapping each of those sequence elements and their corresponding source element to a result element.
Exceptions
T:System.ArgumentNullExceptionsource or collectionSelector or resultSelector is null.

Definition at line 1149 of file Enumerable.cs.

◆ SelectMany< TSource, TCollection, TResult >() [2/2]

static IEnumerable<TResult> System.Linq.Enumerable.SelectMany< TSource, TCollection, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, IEnumerable< TCollection >>  collectionSelector,
Func< TSource, TCollection, TResult >  resultSelector 
)
static

Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1, flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.

Parameters
sourceA sequence of values to project.
collectionSelectorA transform function to apply to each element of the input sequence.
resultSelectorA transform function to apply to each element of the intermediate sequence.
Template Parameters
TSourceThe type of the elements of source .
TCollectionThe type of the intermediate elements collected by collectionSelector .
TResultThe type of the elements of the resulting sequence.
Returns
An T:System.Collections.Generic.IEnumerable`1 whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of source and then mapping each of those sequence elements and their corresponding source element to a result element.
Exceptions
T:System.ArgumentNullExceptionsource or collectionSelector or resultSelector is null.

Definition at line 1190 of file Enumerable.cs.

◆ SelectMany< TSource, TResult >() [1/2]

static IEnumerable<TResult> System.Linq.Enumerable.SelectMany< TSource, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, IEnumerable< TResult >>  selector 
)
static

Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1 and flattens the resulting sequences into one sequence.

Parameters
sourceA sequence of values to project.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
TResultThe type of the elements of the sequence returned by selector .
Returns
An T:System.Collections.Generic.IEnumerable`1 whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 1079 of file Enumerable.cs.

◆ SelectMany< TSource, TResult >() [2/2]

static IEnumerable<TResult> System.Linq.Enumerable.SelectMany< TSource, TResult > ( this IEnumerable< TSource >  source,
Func< TSource, int, IEnumerable< TResult >>  selector 
)
static

Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1, and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element.

Parameters
sourceA sequence of values to project.
selectorA transform function to apply to each source element; the second parameter of the function represents the index of the source element.
Template Parameters
TSourceThe type of the elements of source .
TResultThe type of the elements of the sequence returned by selector .
Returns
An T:System.Collections.Generic.IEnumerable`1 whose elements are the result of invoking the one-to-many transform function on each element of an input sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 1112 of file Enumerable.cs.

◆ SequenceEqual< TSource >() [1/2]

static bool System.Linq.Enumerable.SequenceEqual< TSource > ( this IEnumerable< TSource >  first,
IEnumerable< TSource >  second 
)
static

Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.

Parameters
firstAn T:System.Collections.Generic.IEnumerable`1 to compare to second .
secondAn T:System.Collections.Generic.IEnumerable`1 to compare to the first sequence.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
true if the two source sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 2204 of file Enumerable.cs.

◆ SequenceEqual< TSource >() [2/2]

static bool System.Linq.Enumerable.SequenceEqual< TSource > ( this IEnumerable< TSource >  first,
IEnumerable< TSource >  second,
IEqualityComparer< TSource >  comparer 
)
static

Determines whether two sequences are equal by comparing their elements by using a specified T:System.Collections.Generic.IEqualityComparer`1.

Parameters
firstAn T:System.Collections.Generic.IEnumerable`1 to compare to second .
secondAn T:System.Collections.Generic.IEnumerable`1 to compare to the first sequence.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to use to compare elements.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
true if the two source sequences are of equal length and their corresponding elements compare equal according to comparer ; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 2219 of file Enumerable.cs.

◆ Single< TSource >() [1/2]

static TSource System.Linq.Enumerable.Single< TSource > ( this IEnumerable< TSource >  source)
static

Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return the single element of.
Template Parameters
TSourceThe type of the elements of source .
Returns
The single element of the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionThe input sequence contains more than one element.-or-The input sequence is empty.

Definition at line 2837 of file Enumerable.cs.

◆ Single< TSource >() [2/2]

static TSource System.Linq.Enumerable.Single< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return a single element from.
predicateA function to test an element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
The single element of the input sequence that satisfies a condition.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.
T:System.InvalidOperationExceptionNo element satisfies the condition in predicate .-or-More than one element satisfies the condition in predicate .-or-The source sequence is empty.

Definition at line 2881 of file Enumerable.cs.

◆ SingleOrDefault< TSource >() [1/2]

static TSource System.Linq.Enumerable.SingleOrDefault< TSource > ( this IEnumerable< TSource >  source)
static

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.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return the single element of.
Template Parameters
TSourceThe type of the elements of source .
Returns
The single element of the input sequence, or default(TSource ) if the sequence contains no elements.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.InvalidOperationExceptionThe input sequence contains more than one element.

Definition at line 2920 of file Enumerable.cs.

◆ SingleOrDefault< TSource >() [2/2]

static TSource System.Linq.Enumerable.SingleOrDefault< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

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.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return a single element from.
predicateA function to test an element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
The single element of the input sequence that satisfies the condition, or default(TSource ) if no such element is found.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 2963 of file Enumerable.cs.

◆ Skip< TSource >()

static IEnumerable<TSource> System.Linq.Enumerable.Skip< TSource > ( this IEnumerable< TSource >  source,
int  count 
)
static

Bypasses a specified number of elements in a sequence and then returns the remaining elements.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return elements from.
countThe number of elements to skip before returning the remaining elements.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains the elements that occur after the specified index in the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1328 of file Enumerable.cs.

◆ SkipWhile< TSource >() [1/2]

static IEnumerable<TSource> System.Linq.Enumerable.SkipWhile< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return elements from.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate .
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 1363 of file Enumerable.cs.

◆ SkipWhile< TSource >() [2/2]

static IEnumerable<TSource> System.Linq.Enumerable.SkipWhile< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int, bool >  predicate 
)
static

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.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to return elements from.
predicateA function to test each source element for a condition; the second parameter of the function represents the index of the source element.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate .
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 1400 of file Enumerable.cs.

◆ Sum() [1/10]

static int System.Linq.Enumerable.Sum ( this IEnumerable< int >  source)
static

Computes the sum of a sequence of T:System.Int32 values.

Parameters
sourceA sequence of T:System.Int32 values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe sum is larger than F:System.Int32.MaxValue.

Definition at line 3486 of file Enumerable.cs.

◆ Sum() [2/10]

static ? int System.Linq.Enumerable.Sum ( this IEnumerable< int?>  source)
static

Computes the sum of a sequence of nullable T:System.Int32 values.

Parameters
sourceA sequence of nullable T:System.Int32 values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe sum is larger than F:System.Int32.MaxValue.

Definition at line 3507 of file Enumerable.cs.

◆ Sum() [3/10]

static long System.Linq.Enumerable.Sum ( this IEnumerable< long >  source)
static

Computes the sum of a sequence of T:System.Int64 values.

Parameters
sourceA sequence of T:System.Int64 values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe sum is larger than F:System.Int64.MaxValue.

Definition at line 3531 of file Enumerable.cs.

◆ Sum() [4/10]

static ? long System.Linq.Enumerable.Sum ( this IEnumerable< long?>  source)
static

Computes the sum of a sequence of nullable T:System.Int64 values.

Parameters
sourceA sequence of nullable T:System.Int64 values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe sum is larger than F:System.Int64.MaxValue.

Definition at line 3552 of file Enumerable.cs.

◆ Sum() [5/10]

static float System.Linq.Enumerable.Sum ( this IEnumerable< float >  source)
static

Computes the sum of a sequence of T:System.Single values.

Parameters
sourceA sequence of T:System.Single values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3575 of file Enumerable.cs.

◆ Sum() [6/10]

static ? float System.Linq.Enumerable.Sum ( this IEnumerable< float?>  source)
static

Computes the sum of a sequence of nullable T:System.Single values.

Parameters
sourceA sequence of nullable T:System.Single values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3595 of file Enumerable.cs.

◆ Sum() [7/10]

static double System.Linq.Enumerable.Sum ( this IEnumerable< double >  source)
static

Computes the sum of a sequence of T:System.Double values.

Parameters
sourceA sequence of T:System.Double values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3618 of file Enumerable.cs.

◆ Sum() [8/10]

static ? double System.Linq.Enumerable.Sum ( this IEnumerable< double?>  source)
static

Computes the sum of a sequence of nullable T:System.Double values.

Parameters
sourceA sequence of nullable T:System.Double values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 3638 of file Enumerable.cs.

◆ Sum() [9/10]

static decimal System.Linq.Enumerable.Sum ( this IEnumerable< decimal >  source)
static

Computes the sum of a sequence of T:System.Decimal values.

Parameters
sourceA sequence of T:System.Decimal values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe sum is larger than F:System.Decimal.MaxValue.

Definition at line 3662 of file Enumerable.cs.

◆ Sum() [10/10]

static ? decimal System.Linq.Enumerable.Sum ( this IEnumerable< decimal?>  source)
static

Computes the sum of a sequence of nullable T:System.Decimal values.

Parameters
sourceA sequence of nullable T:System.Decimal values to calculate the sum of.
Returns
The sum of the values in the sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.OverflowExceptionThe sum is larger than F:System.Decimal.MaxValue.

Definition at line 3683 of file Enumerable.cs.

◆ Sum< TSource >() [1/10]

static int System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int >  selector 
)
static

Computes the sum of the sequence of T:System.Int32 values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.OverflowExceptionThe sum is larger than F:System.Int32.MaxValue.

Definition at line 3709 of file Enumerable.cs.

◆ Sum< TSource >() [2/10]

static ? int System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int?>  selector 
)
static

Computes the sum of the sequence of nullable T:System.Int32 values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.OverflowExceptionThe sum is larger than F:System.Int32.MaxValue.

Definition at line 3723 of file Enumerable.cs.

◆ Sum< TSource >() [3/10]

static long System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, long >  selector 
)
static

Computes the sum of the sequence of T:System.Int64 values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.OverflowExceptionThe sum is larger than F:System.Int64.MaxValue.

Definition at line 3737 of file Enumerable.cs.

◆ Sum< TSource >() [4/10]

static ? long System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, long?>  selector 
)
static

Computes the sum of the sequence of nullable T:System.Int64 values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.OverflowExceptionThe sum is larger than F:System.Int64.MaxValue.

Definition at line 3751 of file Enumerable.cs.

◆ Sum< TSource >() [5/10]

static float System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, float >  selector 
)
static

Computes the sum of the sequence of T:System.Single values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 3764 of file Enumerable.cs.

◆ Sum< TSource >() [6/10]

static ? float System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, float?>  selector 
)
static

Computes the sum of the sequence of nullable T:System.Single values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 3777 of file Enumerable.cs.

◆ Sum< TSource >() [7/10]

static double System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, double >  selector 
)
static

Computes the sum of the sequence of T:System.Double values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 3790 of file Enumerable.cs.

◆ Sum< TSource >() [8/10]

static ? double System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, double?>  selector 
)
static

Computes the sum of the sequence of nullable T:System.Double values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 3803 of file Enumerable.cs.

◆ Sum< TSource >() [9/10]

static decimal System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, decimal >  selector 
)
static

Computes the sum of the sequence of T:System.Decimal values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.OverflowExceptionThe sum is larger than F:System.Decimal.MaxValue.

Definition at line 3817 of file Enumerable.cs.

◆ Sum< TSource >() [10/10]

static ? decimal System.Linq.Enumerable.Sum< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, decimal?>  selector 
)
static

Computes the sum of the sequence of nullable T:System.Decimal values that are obtained by invoking a transform function on each element of the input sequence.

Parameters
sourceA sequence of values that are used to calculate a sum.
selectorA transform function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
Returns
The sum of the projected values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.
T:System.OverflowExceptionThe sum is larger than F:System.Decimal.MaxValue.

Definition at line 3831 of file Enumerable.cs.

◆ Take< TSource >()

static IEnumerable<TSource> System.Linq.Enumerable.Take< TSource > ( this IEnumerable< TSource >  source,
int  count 
)
static

Returns a specified number of contiguous elements from the start of a sequence.

Parameters
sourceThe sequence to return elements from.
countThe number of elements to return.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains the specified number of elements from the start of the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1226 of file Enumerable.cs.

◆ TakeWhile< TSource >() [1/2]

static IEnumerable<TSource> System.Linq.Enumerable.TakeWhile< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Returns elements from a sequence as long as a specified condition is true.

Parameters
sourceA sequence to return elements from.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains the elements from the input sequence that occur before the element at which the test no longer passes.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 1260 of file Enumerable.cs.

◆ TakeWhile< TSource >() [2/2]

static IEnumerable<TSource> System.Linq.Enumerable.TakeWhile< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int, bool >  predicate 
)
static

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.

Parameters
sourceThe sequence to return elements from.
predicateA function to test each source element for a condition; the second parameter of the function represents the index of the source element.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains elements from the input sequence that occur before the element at which the test no longer passes.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 1293 of file Enumerable.cs.

◆ ThenBy< TSource, TKey >() [1/2]

static IOrderedEnumerable<TSource> System.Linq.Enumerable.ThenBy< TSource, TKey > ( this IOrderedEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector 
)
static

Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.

Parameters
sourceAn T:System.Linq.IOrderedEnumerable`1 that contains elements to sort.
keySelectorA function to extract a key from each element.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An T:System.Linq.IOrderedEnumerable`1 whose elements are sorted according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1681 of file Enumerable.cs.

◆ ThenBy< TSource, TKey >() [2/2]

static IOrderedEnumerable<TSource> System.Linq.Enumerable.ThenBy< TSource, TKey > ( this IOrderedEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
IComparer< TKey >  comparer 
)
static

Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer.

Parameters
sourceAn T:System.Linq.IOrderedEnumerable`1 that contains elements to sort.
keySelectorA function to extract a key from each element.
comparerAn T:System.Collections.Generic.IComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An T:System.Linq.IOrderedEnumerable`1 whose elements are sorted according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1700 of file Enumerable.cs.

◆ ThenByDescending< TSource, TKey >() [1/2]

static IOrderedEnumerable<TSource> System.Linq.Enumerable.ThenByDescending< TSource, TKey > ( this IOrderedEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector 
)
static

Performs a subsequent ordering of the elements in a sequence in descending order, according to a key.

Parameters
sourceAn T:System.Linq.IOrderedEnumerable`1 that contains elements to sort.
keySelectorA function to extract a key from each element.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An T:System.Linq.IOrderedEnumerable`1 whose elements are sorted in descending order according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1718 of file Enumerable.cs.

◆ ThenByDescending< TSource, TKey >() [2/2]

static IOrderedEnumerable<TSource> System.Linq.Enumerable.ThenByDescending< TSource, TKey > ( this IOrderedEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
IComparer< TKey >  comparer 
)
static

Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer.

Parameters
sourceAn T:System.Linq.IOrderedEnumerable`1 that contains elements to sort.
keySelectorA function to extract a key from each element.
comparerAn T:System.Collections.Generic.IComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
An T:System.Linq.IOrderedEnumerable`1 whose elements are sorted in descending order according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 1737 of file Enumerable.cs.

◆ ToArray< TSource >()

static TSource [] System.Linq.Enumerable.ToArray< TSource > ( this IEnumerable< TSource >  source)
static

Creates an array from a T:System.Collections.Generic.IEnumerable`1.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to create an array from.
Template Parameters
TSourceThe type of the elements of source .
Returns
An array that contains the elements from the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2270 of file Enumerable.cs.

◆ ToDictionary< TSource, TKey >() [1/2]

static Dictionary<TKey, TSource> System.Linq.Enumerable.ToDictionary< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector 
)
static

Creates a T:System.Collections.Generic.Dictionary`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to create a T:System.Collections.Generic.Dictionary`2 from.
keySelectorA function to extract a key from each element.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
A T:System.Collections.Generic.Dictionary`2 that contains keys and values.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.-or- keySelector produces a key that is null.
T:System.ArgumentExceptionkeySelector produces duplicate keys for two elements.

Definition at line 2307 of file Enumerable.cs.

◆ ToDictionary< TSource, TKey >() [2/2]

static Dictionary<TKey, TSource> System.Linq.Enumerable.ToDictionary< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
IEqualityComparer< TKey >  comparer 
)
static

Creates a T:System.Collections.Generic.Dictionary`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function and key comparer.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to create a T:System.Collections.Generic.Dictionary`2 from.
keySelectorA function to extract a key from each element.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the keys returned by keySelector .
Returns
A T:System.Collections.Generic.Dictionary`2 that contains keys and values.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.-or- keySelector produces a key that is null.
T:System.ArgumentExceptionkeySelector produces duplicate keys for two elements.

Definition at line 2325 of file Enumerable.cs.

◆ ToDictionary< TSource, TKey, TElement >() [1/2]

static Dictionary<TKey, TElement> System.Linq.Enumerable.ToDictionary< TSource, TKey, TElement > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TSource, TElement >  elementSelector 
)
static

Creates a T:System.Collections.Generic.Dictionary`2 from an T:System.Collections.Generic.IEnumerable`1 according to specified key selector and element selector functions.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to create a T:System.Collections.Generic.Dictionary`2 from.
keySelectorA function to extract a key from each element.
elementSelectorA transform function to produce a result element value from each element.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TElementThe type of the value returned by elementSelector .
Returns
A T:System.Collections.Generic.Dictionary`2 that contains values of type TElement selected from the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector is null.-or- keySelector produces a key that is null.
T:System.ArgumentExceptionkeySelector produces duplicate keys for two elements.

Definition at line 2344 of file Enumerable.cs.

◆ ToDictionary< TSource, TKey, TElement >() [2/2]

static Dictionary<TKey, TElement> System.Linq.Enumerable.ToDictionary< TSource, TKey, TElement > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TSource, TElement >  elementSelector,
IEqualityComparer< TKey >  comparer 
)
static

Creates a T:System.Collections.Generic.Dictionary`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function, a comparer, and an element selector function.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to create a T:System.Collections.Generic.Dictionary`2 from.
keySelectorA function to extract a key from each element.
elementSelectorA transform function to produce a result element value from each element.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TElementThe type of the value returned by elementSelector .
Returns
A T:System.Collections.Generic.Dictionary`2 that contains values of type TElement selected from the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector is null.-or- keySelector produces a key that is null.
T:System.ArgumentExceptionkeySelector produces duplicate keys for two elements.

Definition at line 2364 of file Enumerable.cs.

◆ ToList< TSource >()

static List<TSource> System.Linq.Enumerable.ToList< TSource > ( this IEnumerable< TSource >  source)
static

Creates a T:System.Collections.Generic.List`1 from an T:System.Collections.Generic.IEnumerable`1.

Parameters
sourceThe T:System.Collections.Generic.IEnumerable`1 to create a T:System.Collections.Generic.List`1 from.
Template Parameters
TSourceThe type of the elements of source .
Returns
A T:System.Collections.Generic.List`1 that contains elements from the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2286 of file Enumerable.cs.

◆ ToLookup< TSource, TKey >() [1/2]

static ILookup<TKey, TSource> System.Linq.Enumerable.ToLookup< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector 
)
static

Creates a T:System.Linq.Lookup`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function.

Parameters
sourceThe T:System.Collections.Generic.IEnumerable`1 to create a T:System.Linq.Lookup`2 from.
keySelectorA function to extract a key from each element.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
A T:System.Linq.Lookup`2 that contains keys and values.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 2395 of file Enumerable.cs.

◆ ToLookup< TSource, TKey >() [2/2]

static ILookup<TKey, TSource> System.Linq.Enumerable.ToLookup< TSource, TKey > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
IEqualityComparer< TKey >  comparer 
)
static

Creates a T:System.Linq.Lookup`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function and key comparer.

Parameters
sourceThe T:System.Collections.Generic.IEnumerable`1 to create a T:System.Linq.Lookup`2 from.
keySelectorA function to extract a key from each element.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
Returns
A T:System.Linq.Lookup`2 that contains keys and values.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 2410 of file Enumerable.cs.

◆ ToLookup< TSource, TKey, TElement >() [1/2]

static ILookup<TKey, TElement> System.Linq.Enumerable.ToLookup< TSource, TKey, TElement > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TSource, TElement >  elementSelector 
)
static

Creates a T:System.Linq.Lookup`2 from an T:System.Collections.Generic.IEnumerable`1 according to specified key selector and element selector functions.

Parameters
sourceThe T:System.Collections.Generic.IEnumerable`1 to create a T:System.Linq.Lookup`2 from.
keySelectorA function to extract a key from each element.
elementSelectorA transform function to produce a result element value from each element.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TElementThe type of the value returned by elementSelector .
Returns
A T:System.Linq.Lookup`2 that contains values of type TElement selected from the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector is null.

Definition at line 2426 of file Enumerable.cs.

◆ ToLookup< TSource, TKey, TElement >() [2/2]

static ILookup<TKey, TElement> System.Linq.Enumerable.ToLookup< TSource, TKey, TElement > ( this IEnumerable< TSource >  source,
Func< TSource, TKey >  keySelector,
Func< TSource, TElement >  elementSelector,
IEqualityComparer< TKey >  comparer 
)
static

Creates a T:System.Linq.Lookup`2 from an T:System.Collections.Generic.IEnumerable`1 according to a specified key selector function, a comparer and an element selector function.

Parameters
sourceThe T:System.Collections.Generic.IEnumerable`1 to create a T:System.Linq.Lookup`2 from.
keySelectorA function to extract a key from each element.
elementSelectorA transform function to produce a result element value from each element.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare keys.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by keySelector .
TElementThe type of the value returned by elementSelector .
Returns
A T:System.Linq.Lookup`2 that contains values of type TElement selected from the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector is null.

Definition at line 2443 of file Enumerable.cs.

◆ Union< TSource >() [1/2]

static IEnumerable<TSource> System.Linq.Enumerable.Union< TSource > ( this IEnumerable< TSource >  first,
IEnumerable< TSource >  second 
)
static

Produces the set union of two sequences by using the default equality comparer.

Parameters
firstAn T:System.Collections.Generic.IEnumerable`1 whose distinct elements form the first set for the union.
secondAn T:System.Collections.Generic.IEnumerable`1 whose distinct elements form the second set for the union.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains the elements from both input sequences, excluding duplicates.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 1998 of file Enumerable.cs.

◆ Union< TSource >() [2/2]

static IEnumerable<TSource> System.Linq.Enumerable.Union< TSource > ( this IEnumerable< TSource >  first,
IEnumerable< TSource >  second,
IEqualityComparer< TSource >  comparer 
)
static

Produces the set union of two sequences by using a specified T:System.Collections.Generic.IEqualityComparer`1.

Parameters
firstAn T:System.Collections.Generic.IEnumerable`1 whose distinct elements form the first set for the union.
secondAn T:System.Collections.Generic.IEnumerable`1 whose distinct elements form the second set for the union.
comparerThe T:System.Collections.Generic.IEqualityComparer`1 to compare values.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains the elements from both input sequences, excluding duplicates.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 2020 of file Enumerable.cs.

◆ Where< TSource >() [1/2]

static IEnumerable<TSource> System.Linq.Enumerable.Where< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, bool >  predicate 
)
static

Filters a sequence of values based on a predicate.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to filter.
predicateA function to test each element for a condition.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains elements from the input sequence that satisfy the condition.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 928 of file Enumerable.cs.

◆ Where< TSource >() [2/2]

static IEnumerable<TSource> System.Linq.Enumerable.Where< TSource > ( this IEnumerable< TSource >  source,
Func< TSource, int, bool >  predicate 
)
static

Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.

Parameters
sourceAn T:System.Collections.Generic.IEnumerable`1 to filter.
predicateA function to test each source element for a condition; the second parameter of the function represents the index of the source element.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains elements from the input sequence that satisfy the condition.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 961 of file Enumerable.cs.

◆ Zip< TFirst, TSecond, TResult >()

static IEnumerable<TResult> System.Linq.Enumerable.Zip< TFirst, TSecond, TResult > ( this IEnumerable< TFirst >  first,
IEnumerable< TSecond >  second,
Func< TFirst, TSecond, TResult >  resultSelector 
)
static

Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.

Parameters
firstThe first sequence to merge.
secondThe second sequence to merge.
resultSelectorA function that specifies how to merge the elements from the two sequences.
Template Parameters
TFirstThe type of the elements of the first input sequence.
TSecondThe type of the elements of the second input sequence.
TResultThe type of the elements of the result sequence.
Returns
An T:System.Collections.Generic.IEnumerable`1 that contains merged elements of two input sequences.
Exceptions
T:System.ArgumentNullExceptionfirst or second is null.

Definition at line 1914 of file Enumerable.cs.


The documentation for this class was generated from the following file: