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

Provides a set of static (Shared in Visual Basic) methods for querying data structures that implement T:System.Linq.IQueryable`1. More...

Static Public Member Functions

static IQueryable< TElement > AsQueryable< TElement > (this IEnumerable< TElement > source)
 Converts a generic T:System.Collections.Generic.IEnumerable`1 to a generic T:System.Linq.IQueryable`1. More...
 
static IQueryable AsQueryable (this IEnumerable source)
 Converts an T:System.Collections.IEnumerable to an T:System.Linq.IQueryable. More...
 
static IQueryable< TSource > Where< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, bool >> predicate)
 Filters a sequence of values based on a predicate. More...
 
static IQueryable< TSource > Where< TSource > (this IQueryable< TSource > source, Expression< 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 IQueryable< TResult > OfType< TResult > (this IQueryable source)
 Filters the elements of an T:System.Linq.IQueryable based on a specified type. More...
 
static IQueryable< TResult > Cast< TResult > (this IQueryable source)
 Converts the elements of an T:System.Linq.IQueryable to the specified type. More...
 
static IQueryable< TResult > Select< TSource, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, TResult >> selector)
 Projects each element of a sequence into a new form. More...
 
static IQueryable< TResult > Select< TSource, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, int, TResult >> selector)
 Projects each element of a sequence into a new form by incorporating the element's index. More...
 
static IQueryable< TResult > SelectMany< TSource, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, IEnumerable< TResult >>> selector)
 Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1 and combines the resulting sequences into one sequence. More...
 
static IQueryable< TResult > SelectMany< TSource, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, int, IEnumerable< TResult >>> selector)
 Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1 and combines the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. More...
 
static IQueryable< TResult > SelectMany< TSource, TCollection, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, int, IEnumerable< TCollection >>> collectionSelector, Expression< Func< TSource, TCollection, TResult >> resultSelector)
 Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1 that incorporates the index of the source element that produced it. A result selector function is invoked on each element of each intermediate sequence, and the resulting values are combined into a single, one-dimensional sequence and returned. More...
 
static IQueryable< TResult > SelectMany< TSource, TCollection, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, IEnumerable< TCollection >>> collectionSelector, Expression< Func< TSource, TCollection, TResult >> resultSelector)
 Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1 and invokes a result selector function on each element therein. The resulting values from each intermediate sequence are combined into a single, one-dimensional sequence and returned. More...
 
static IQueryable< TResult > Join< TOuter, TInner, TKey, TResult > (this IQueryable< TOuter > outer, IEnumerable< TInner > inner, Expression< Func< TOuter, TKey >> outerKeySelector, Expression< Func< TInner, TKey >> innerKeySelector, Expression< 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 IQueryable< TResult > Join< TOuter, TInner, TKey, TResult > (this IQueryable< TOuter > outer, IEnumerable< TInner > inner, Expression< Func< TOuter, TKey >> outerKeySelector, Expression< Func< TInner, TKey >> innerKeySelector, Expression< 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 IQueryable< TResult > GroupJoin< TOuter, TInner, TKey, TResult > (this IQueryable< TOuter > outer, IEnumerable< TInner > inner, Expression< Func< TOuter, TKey >> outerKeySelector, Expression< Func< TInner, TKey >> innerKeySelector, Expression< Func< TOuter, IEnumerable< TInner >, TResult >> resultSelector)
 Correlates the elements of two sequences based on key equality and groups the results. The default equality comparer is used to compare keys. More...
 
static IQueryable< TResult > GroupJoin< TOuter, TInner, TKey, TResult > (this IQueryable< TOuter > outer, IEnumerable< TInner > inner, Expression< Func< TOuter, TKey >> outerKeySelector, Expression< Func< TInner, TKey >> innerKeySelector, Expression< 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 IOrderedQueryable< TSource > OrderBy< TSource, TKey > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector)
 Sorts the elements of a sequence in ascending order according to a key. More...
 
static IOrderedQueryable< TSource > OrderBy< TSource, TKey > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector, IComparer< TKey > comparer)
 Sorts the elements of a sequence in ascending order by using a specified comparer. More...
 
static IOrderedQueryable< TSource > OrderByDescending< TSource, TKey > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector)
 Sorts the elements of a sequence in descending order according to a key. More...
 
static IOrderedQueryable< TSource > OrderByDescending< TSource, TKey > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector, IComparer< TKey > comparer)
 Sorts the elements of a sequence in descending order by using a specified comparer. More...
 
static IOrderedQueryable< TSource > ThenBy< TSource, TKey > (this IOrderedQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector)
 Performs a subsequent ordering of the elements in a sequence in ascending order according to a key. More...
 
static IOrderedQueryable< TSource > ThenBy< TSource, TKey > (this IOrderedQueryable< TSource > source, Expression< 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 IOrderedQueryable< TSource > ThenByDescending< TSource, TKey > (this IOrderedQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector)
 Performs a subsequent ordering of the elements in a sequence in descending order, according to a key. More...
 
static IOrderedQueryable< TSource > ThenByDescending< TSource, TKey > (this IOrderedQueryable< TSource > source, Expression< 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 IQueryable< TSource > Take< TSource > (this IQueryable< TSource > source, int count)
 Returns a specified number of contiguous elements from the start of a sequence. More...
 
static IQueryable< TSource > TakeWhile< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, bool >> predicate)
 Returns elements from a sequence as long as a specified condition is true. More...
 
static IQueryable< TSource > TakeWhile< TSource > (this IQueryable< TSource > source, Expression< 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 IQueryable< TSource > Skip< TSource > (this IQueryable< TSource > source, int count)
 Bypasses a specified number of elements in a sequence and then returns the remaining elements. More...
 
static IQueryable< TSource > SkipWhile< TSource > (this IQueryable< TSource > source, Expression< 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 IQueryable< TSource > SkipWhile< TSource > (this IQueryable< TSource > source, Expression< 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 IQueryable< IGrouping< TKey, TSource > > GroupBy< TSource, TKey > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector)
 Groups the elements of a sequence according to a specified key selector function. More...
 
static IQueryable< IGrouping< TKey, TElement > > GroupBy< TSource, TKey, TElement > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector, Expression< 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 IQueryable< IGrouping< TKey, TSource > > GroupBy< TSource, TKey > (this IQueryable< TSource > source, Expression< 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 IQueryable< IGrouping< TKey, TElement > > GroupBy< TSource, TKey, TElement > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector, Expression< Func< TSource, TElement >> elementSelector, IEqualityComparer< TKey > comparer)
 Groups the elements of a sequence and projects the elements for each group by using a specified function. Key values are compared by using a specified comparer. More...
 
static IQueryable< TResult > GroupBy< TSource, TKey, TElement, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector, Expression< Func< TSource, TElement >> elementSelector, Expression< 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 IQueryable< TResult > GroupBy< TSource, TKey, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector, Expression< 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 IQueryable< TResult > GroupBy< TSource, TKey, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector, Expression< 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. Keys are compared by using a specified comparer. More...
 
static IQueryable< TResult > GroupBy< TSource, TKey, TElement, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, TKey >> keySelector, Expression< Func< TSource, TElement >> elementSelector, Expression< 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. Keys are compared by using a specified comparer and the elements of each group are projected by using a specified function. More...
 
static IQueryable< TSource > Distinct< TSource > (this IQueryable< TSource > source)
 Returns distinct elements from a sequence by using the default equality comparer to compare values. More...
 
static IQueryable< TSource > Distinct< TSource > (this IQueryable< 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 IQueryable< TSource > Concat< TSource > (this IQueryable< TSource > source1, IEnumerable< TSource > source2)
 Concatenates two sequences. More...
 
static IQueryable< TResult > Zip< TFirst, TSecond, TResult > (this IQueryable< TFirst > source1, IEnumerable< TSecond > source2, Expression< Func< TFirst, TSecond, TResult >> resultSelector)
 Merges two sequences by using the specified predicate function. More...
 
static IQueryable< TSource > Union< TSource > (this IQueryable< TSource > source1, IEnumerable< TSource > source2)
 Produces the set union of two sequences by using the default equality comparer. More...
 
static IQueryable< TSource > Union< TSource > (this IQueryable< TSource > source1, IEnumerable< TSource > source2, IEqualityComparer< TSource > comparer)
 Produces the set union of two sequences by using a specified T:System.Collections.Generic.IEqualityComparer`1. More...
 
static IQueryable< TSource > Intersect< TSource > (this IQueryable< TSource > source1, IEnumerable< TSource > source2)
 Produces the set intersection of two sequences by using the default equality comparer to compare values. More...
 
static IQueryable< TSource > Intersect< TSource > (this IQueryable< TSource > source1, IEnumerable< TSource > source2, 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 IQueryable< TSource > Except< TSource > (this IQueryable< TSource > source1, IEnumerable< TSource > source2)
 Produces the set difference of two sequences by using the default equality comparer to compare values. More...
 
static IQueryable< TSource > Except< TSource > (this IQueryable< TSource > source1, IEnumerable< TSource > source2, 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 TSource First< TSource > (this IQueryable< TSource > source)
 Returns the first element of a sequence. More...
 
static TSource First< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, bool >> predicate)
 Returns the first element of a sequence that satisfies a specified condition. More...
 
static TSource FirstOrDefault< TSource > (this IQueryable< 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 IQueryable< TSource > source, Expression< Func< TSource, bool >> predicate)
 Returns the first element of a sequence that satisfies a specified condition or a default value if no such element is found. More...
 
static TSource Last< TSource > (this IQueryable< TSource > source)
 Returns the last element in a sequence. More...
 
static TSource Last< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, bool >> predicate)
 Returns the last element of a sequence that satisfies a specified condition. More...
 
static TSource LastOrDefault< TSource > (this IQueryable< TSource > source)
 Returns the last element in a sequence, or a default value if the sequence contains no elements. More...
 
static TSource LastOrDefault< TSource > (this IQueryable< TSource > source, Expression< 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 IQueryable< 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 IQueryable< TSource > source, Expression< 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 IQueryable< 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 IQueryable< TSource > source, Expression< 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 IQueryable< TSource > source, int index)
 Returns the element at a specified index in a sequence. More...
 
static TSource ElementAtOrDefault< TSource > (this IQueryable< 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 IQueryable< TSource > DefaultIfEmpty< TSource > (this IQueryable< 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 IQueryable< TSource > DefaultIfEmpty< TSource > (this IQueryable< 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 bool Contains< TSource > (this IQueryable< TSource > source, TSource item)
 Determines whether a sequence contains a specified element by using the default equality comparer. More...
 
static bool Contains< TSource > (this IQueryable< TSource > source, TSource item, IEqualityComparer< TSource > comparer)
 Determines whether a sequence contains a specified element by using a specified T:System.Collections.Generic.IEqualityComparer`1. More...
 
static IQueryable< TSource > Reverse< TSource > (this IQueryable< TSource > source)
 Inverts the order of the elements in a sequence. More...
 
static bool SequenceEqual< TSource > (this IQueryable< TSource > source1, IEnumerable< TSource > source2)
 Determines whether two sequences are equal by using the default equality comparer to compare elements. More...
 
static bool SequenceEqual< TSource > (this IQueryable< TSource > source1, IEnumerable< TSource > source2, IEqualityComparer< TSource > comparer)
 Determines whether two sequences are equal by using a specified T:System.Collections.Generic.IEqualityComparer`1 to compare elements. More...
 
static bool Any< TSource > (this IQueryable< TSource > source)
 Determines whether a sequence contains any elements. More...
 
static bool Any< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, bool >> predicate)
 Determines whether any element of a sequence satisfies a condition. More...
 
static bool All< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, bool >> predicate)
 Determines whether all the elements of a sequence satisfy a condition. More...
 
static int Count< TSource > (this IQueryable< TSource > source)
 Returns the number of elements in a sequence. More...
 
static int Count< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, bool >> predicate)
 Returns the number of elements in the specified sequence that satisfies a condition. More...
 
static long LongCount< TSource > (this IQueryable< TSource > source)
 Returns an T:System.Int64 that represents the total number of elements in a sequence. More...
 
static long LongCount< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, bool >> predicate)
 Returns an T:System.Int64 that represents the number of elements in a sequence that satisfy a condition. More...
 
static TSource Min< TSource > (this IQueryable< TSource > source)
 Returns the minimum value of a generic T:System.Linq.IQueryable`1. More...
 
static TResult Min< TSource, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, TResult >> selector)
 Invokes a projection function on each element of a generic T:System.Linq.IQueryable`1 and returns the minimum resulting value. More...
 
static TSource Max< TSource > (this IQueryable< TSource > source)
 Returns the maximum value in a generic T:System.Linq.IQueryable`1. More...
 
static TResult Max< TSource, TResult > (this IQueryable< TSource > source, Expression< Func< TSource, TResult >> selector)
 Invokes a projection function on each element of a generic T:System.Linq.IQueryable`1 and returns the maximum resulting value. More...
 
static int Sum (this IQueryable< int > source)
 Computes the sum of a sequence of T:System.Int32 values. More...
 
static ? int Sum (this IQueryable< int?> source)
 Computes the sum of a sequence of nullable T:System.Int32 values. More...
 
static long Sum (this IQueryable< long > source)
 Computes the sum of a sequence of T:System.Int64 values. More...
 
static ? long Sum (this IQueryable< long?> source)
 Computes the sum of a sequence of nullable T:System.Int64 values. More...
 
static float Sum (this IQueryable< float > source)
 Computes the sum of a sequence of T:System.Single values. More...
 
static ? float Sum (this IQueryable< float?> source)
 Computes the sum of a sequence of nullable T:System.Single values. More...
 
static double Sum (this IQueryable< double > source)
 Computes the sum of a sequence of T:System.Double values. More...
 
static ? double Sum (this IQueryable< double?> source)
 Computes the sum of a sequence of nullable T:System.Double values. More...
 
static decimal Sum (this IQueryable< decimal > source)
 Computes the sum of a sequence of T:System.Decimal values. More...
 
static ? decimal Sum (this IQueryable< decimal?> source)
 Computes the sum of a sequence of nullable T:System.Decimal values. More...
 
static int Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, int >> selector)
 Computes the sum of the sequence of T:System.Int32 values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? int Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, int?>> selector)
 Computes the sum of the sequence of nullable T:System.Int32 values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static long Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, long >> selector)
 Computes the sum of the sequence of T:System.Int64 values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? long Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, long?>> selector)
 Computes the sum of the sequence of nullable T:System.Int64 values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static float Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, float >> selector)
 Computes the sum of the sequence of T:System.Single values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? float Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, float?>> selector)
 Computes the sum of the sequence of nullable T:System.Single values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static double Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, double >> selector)
 Computes the sum of the sequence of T:System.Double values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? double Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, double?>> selector)
 Computes the sum of the sequence of nullable T:System.Double values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static decimal Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, decimal >> selector)
 Computes the sum of the sequence of T:System.Decimal values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? decimal Sum< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, decimal?>> selector)
 Computes the sum of the sequence of nullable T:System.Decimal values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static double Average (this IQueryable< int > source)
 Computes the average of a sequence of T:System.Int32 values. More...
 
static ? double Average (this IQueryable< int?> source)
 Computes the average of a sequence of nullable T:System.Int32 values. More...
 
static double Average (this IQueryable< long > source)
 Computes the average of a sequence of T:System.Int64 values. More...
 
static ? double Average (this IQueryable< long?> source)
 Computes the average of a sequence of nullable T:System.Int64 values. More...
 
static float Average (this IQueryable< float > source)
 Computes the average of a sequence of T:System.Single values. More...
 
static ? float Average (this IQueryable< float?> source)
 Computes the average of a sequence of nullable T:System.Single values. More...
 
static double Average (this IQueryable< double > source)
 Computes the average of a sequence of T:System.Double values. More...
 
static ? double Average (this IQueryable< double?> source)
 Computes the average of a sequence of nullable T:System.Double values. More...
 
static decimal Average (this IQueryable< decimal > source)
 Computes the average of a sequence of T:System.Decimal values. More...
 
static ? decimal Average (this IQueryable< decimal?> source)
 Computes the average of a sequence of nullable T:System.Decimal values. More...
 
static double Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, int >> selector)
 Computes the average of a sequence of T:System.Int32 values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? double Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, int?>> selector)
 Computes the average of a sequence of nullable T:System.Int32 values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static float Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, float >> selector)
 Computes the average of a sequence of T:System.Single values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? float Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, float?>> selector)
 Computes the average of a sequence of nullable T:System.Single values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static double Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, long >> selector)
 Computes the average of a sequence of T:System.Int64 values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? double Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, long?>> selector)
 Computes the average of a sequence of nullable T:System.Int64 values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static double Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, double >> selector)
 Computes the average of a sequence of T:System.Double values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? double Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, double?>> selector)
 Computes the average of a sequence of nullable T:System.Double values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static decimal Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, decimal >> selector)
 Computes the average of a sequence of T:System.Decimal values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static ? decimal Average< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, decimal?>> selector)
 Computes the average of a sequence of nullable T:System.Decimal values that is obtained by invoking a projection function on each element of the input sequence. More...
 
static TSource Aggregate< TSource > (this IQueryable< TSource > source, Expression< Func< TSource, TSource, TSource >> func)
 Applies an accumulator function over a sequence. More...
 
static TAccumulate Aggregate< TSource, TAccumulate > (this IQueryable< TSource > source, TAccumulate seed, Expression< 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 IQueryable< TSource > source, TAccumulate seed, Expression< Func< TAccumulate, TSource, TAccumulate >> func, Expression< Func< TAccumulate, TResult >> selector)
 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...
 

Detailed Description

Provides a set of static (Shared in Visual Basic) methods for querying data structures that implement T:System.Linq.IQueryable`1.

Definition at line 10 of file Queryable.cs.

Member Function Documentation

◆ Aggregate< TSource >()

static TSource System.Linq.Queryable.Aggregate< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TSource, TSource >>  func 
)
static

Applies an accumulator function over a sequence.

Parameters
sourceA sequence to aggregate over.
funcAn accumulator function to apply to 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 2908 of file Queryable.cs.

◆ Aggregate< TSource, TAccumulate >()

static TAccumulate System.Linq.Queryable.Aggregate< TSource, TAccumulate > ( this IQueryable< TSource >  source,
TAccumulate  seed,
Expression< 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
sourceA sequence to aggregate over.
seedThe initial accumulator value.
funcAn accumulator function to invoke 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 2935 of file Queryable.cs.

◆ Aggregate< TSource, TAccumulate, TResult >()

static TResult System.Linq.Queryable.Aggregate< TSource, TAccumulate, TResult > ( this IQueryable< TSource >  source,
TAccumulate  seed,
Expression< Func< TAccumulate, TSource, TAccumulate >>  func,
Expression< Func< TAccumulate, TResult >>  selector 
)
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
sourceA sequence to aggregate over.
seedThe initial accumulator value.
funcAn accumulator function to invoke on each element.
selectorA 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 selector is null.

Definition at line 2965 of file Queryable.cs.

◆ All< TSource >()

static bool System.Linq.Queryable.All< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, bool >>  predicate 
)
static

Determines whether all the elements of a sequence satisfy a condition.

Parameters
sourceA sequence whose elements to test for a condition.
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 1879 of file Queryable.cs.

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

static bool System.Linq.Queryable.Any< TSource > ( this IQueryable< TSource >  source)
static

Determines whether a sequence contains any elements.

Parameters
sourceA sequence to check for being empty.
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 1835 of file Queryable.cs.

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

static bool System.Linq.Queryable.Any< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, bool >>  predicate 
)
static

Determines whether any element of a sequence satisfies a condition.

Parameters
sourceA sequence whose elements to test for a condition.
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 1853 of file Queryable.cs.

◆ AsQueryable()

static IQueryable System.Linq.Queryable.AsQueryable ( this IEnumerable  source)
static

Converts an T:System.Collections.IEnumerable to an T:System.Linq.IQueryable.

Parameters
sourceA sequence to convert.
Returns
An T:System.Linq.IQueryable that represents the input sequence.
Exceptions
T:System.ArgumentExceptionsource does not implement T:System.Collections.Generic.IEnumerable`1 for some T .
T:System.ArgumentNullExceptionsource is null.

Definition at line 70 of file Queryable.cs.

◆ AsQueryable< TElement >()

static IQueryable<TElement> System.Linq.Queryable.AsQueryable< TElement > ( this IEnumerable< TElement >  source)
static

Converts a generic T:System.Collections.Generic.IEnumerable`1 to a generic T:System.Linq.IQueryable`1.

Parameters
sourceA sequence to convert.
Template Parameters
TElementThe type of the elements of source .
Returns
An T:System.Linq.IQueryable`1 that represents the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 49 of file Queryable.cs.

◆ Average() [1/10]

static double System.Linq.Queryable.Average ( this IQueryable< 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 2486 of file Queryable.cs.

◆ Average() [2/10]

static ? double System.Linq.Queryable.Average ( this IQueryable< 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2501 of file Queryable.cs.

◆ Average() [3/10]

static double System.Linq.Queryable.Average ( this IQueryable< 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 2518 of file Queryable.cs.

◆ Average() [4/10]

static ? double System.Linq.Queryable.Average ( this IQueryable< 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2533 of file Queryable.cs.

◆ Average() [5/10]

static float System.Linq.Queryable.Average ( this IQueryable< 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 2550 of file Queryable.cs.

◆ Average() [6/10]

static ? float System.Linq.Queryable.Average ( this IQueryable< 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2565 of file Queryable.cs.

◆ Average() [7/10]

static double System.Linq.Queryable.Average ( this IQueryable< 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 2582 of file Queryable.cs.

◆ Average() [8/10]

static ? double System.Linq.Queryable.Average ( this IQueryable< 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2597 of file Queryable.cs.

◆ Average() [9/10]

static decimal System.Linq.Queryable.Average ( this IQueryable< 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 2614 of file Queryable.cs.

◆ Average() [10/10]

static ? decimal System.Linq.Queryable.Average ( this IQueryable< 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 2629 of file Queryable.cs.

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

static double System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, int >>  selector 
)
static

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

Parameters
sourceA sequence of values to calculate the average of.
selectorA projection 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 2648 of file Queryable.cs.

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

static ? double System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, int?>>  selector 
)
static

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

Parameters
sourceA sequence of values to calculate the average of.
selectorA projection 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 2673 of file Queryable.cs.

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

static float System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, float >>  selector 
)
static

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

Parameters
sourceA sequence of values to calculate the average of.
selectorA projection 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 2700 of file Queryable.cs.

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

static ? float System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, float?>>  selector 
)
static

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

Parameters
sourceA sequence of values to calculate the average of.
selectorA projection 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 2725 of file Queryable.cs.

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

static double System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, long >>  selector 
)
static

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

Parameters
sourceA sequence of values to calculate the average of.
selectorA projection 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 2752 of file Queryable.cs.

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

static ? double System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, long?>>  selector 
)
static

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

Parameters
sourceA sequence of values to calculate the average of.
selectorA projection 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 2777 of file Queryable.cs.

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

static double System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, double >>  selector 
)
static

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

Parameters
sourceA sequence of values to calculate the average of.
selectorA projection 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 2804 of file Queryable.cs.

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

static ? double System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, double?>>  selector 
)
static

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

Parameters
sourceA sequence of values to calculate the average of.
selectorA projection 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 2829 of file Queryable.cs.

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

static decimal System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, decimal >>  selector 
)
static

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

Parameters
sourceA sequence of values that are used to calculate an average.
selectorA projection 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 2856 of file Queryable.cs.

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

static ? decimal System.Linq.Queryable.Average< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, decimal?>>  selector 
)
static

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

Parameters
sourceA sequence of values to calculate the average of.
selectorA projection 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 null values.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 2881 of file Queryable.cs.

◆ Cast< TResult >()

static IQueryable<TResult> System.Linq.Queryable.Cast< TResult > ( this IQueryable  source)
static

Converts the elements of an T:System.Linq.IQueryable to the specified type.

Parameters
sourceThe T:System.Linq.IQueryable that contains the elements to be converted.
Template Parameters
TResultThe type to convert the elements of source to.
Returns
An T:System.Linq.IQueryable`1 that contains each element of the source sequence converted 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 162 of file Queryable.cs.

◆ Concat< TSource >()

static IQueryable<TSource> System.Linq.Queryable.Concat< TSource > ( this IQueryable< TSource >  source1,
IEnumerable< TSource >  source2 
)
static

Concatenates two sequences.

Parameters
source1The first sequence to concatenate.
source2The sequence to concatenate to the first sequence.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
An T:System.Linq.IQueryable`1 that contains the concatenated elements of the two input sequences.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1159 of file Queryable.cs.

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

static bool System.Linq.Queryable.Contains< TSource > ( this IQueryable< TSource >  source,
TSource  item 
)
static

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

Parameters
sourceAn T:System.Linq.IQueryable`1 in which to locate item .
itemThe object to locate in the sequence.
Template Parameters
TSourceThe type of the elements of source .
Returns
true if the input sequence contains an element that has the specified value; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1720 of file Queryable.cs.

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

static bool System.Linq.Queryable.Contains< TSource > ( this IQueryable< TSource >  source,
TSource  item,
IEqualityComparer< TSource >  comparer 
)
static

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

Parameters
sourceAn T:System.Linq.IQueryable`1 in which to locate item .
itemThe object to locate in the sequence.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare values.
Template Parameters
TSourceThe type of the elements of source .
Returns
true if the input sequence contains an element that has the specified value; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1743 of file Queryable.cs.

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

static int System.Linq.Queryable.Count< TSource > ( this IQueryable< TSource >  source)
static

Returns the number of elements in a sequence.

Parameters
sourceThe T:System.Linq.IQueryable`1 that contains the 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 1904 of file Queryable.cs.

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

static int System.Linq.Queryable.Count< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, bool >>  predicate 
)
static

Returns the number of elements in the specified sequence that satisfies a condition.

Parameters
sourceAn T:System.Linq.IQueryable`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
The number of elements in the sequence that satisfies 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 1922 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.DefaultIfEmpty< TSource > ( this IQueryable< 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 T:System.Linq.IQueryable`1 to return a default value for if empty.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Linq.IQueryable`1 that contains default(TSource ) if source is empty; otherwise, source .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1681 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.DefaultIfEmpty< TSource > ( this IQueryable< 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 T:System.Linq.IQueryable`1 to return the specified value for if empty.
defaultValueThe value to return if the sequence is empty.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Linq.IQueryable`1 that contains defaultValue if source is empty; otherwise, source .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1698 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Distinct< TSource > ( this IQueryable< TSource >  source)
static

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

Parameters
sourceThe T:System.Linq.IQueryable`1 to remove duplicates from.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Linq.IQueryable`1 that contains distinct elements from source .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1121 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Distinct< TSource > ( this IQueryable< 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 T:System.Linq.IQueryable`1 to remove duplicates from.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare values.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Linq.IQueryable`1 that contains distinct elements from source .
Exceptions
T:System.ArgumentNullExceptionsource or comparer is null.

Definition at line 1138 of file Queryable.cs.

◆ ElementAt< TSource >()

static TSource System.Linq.Queryable.ElementAt< TSource > ( this IQueryable< TSource >  source,
int  index 
)
static

Returns the element at a specified index in a sequence.

Parameters
sourceAn T:System.Linq.IQueryable`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 source .
Exceptions
T:System.ArgumentNullExceptionsource is null.
T:System.ArgumentOutOfRangeExceptionindex is less than zero.

Definition at line 1635 of file Queryable.cs.

◆ ElementAtOrDefault< TSource >()

static TSource System.Linq.Queryable.ElementAtOrDefault< TSource > ( this IQueryable< 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.Linq.IQueryable`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 index is outside the bounds of source ; otherwise, the element at the specified position in source .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1661 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Except< TSource > ( this IQueryable< TSource >  source1,
IEnumerable< TSource >  source2 
)
static

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

Parameters
source1An T:System.Linq.IQueryable`1 whose elements that are not also in source2 will be returned.
source2An T:System.Collections.Generic.IEnumerable`1 whose elements that also occur in the first sequence will not appear in the returned sequence.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
An T:System.Linq.IQueryable`1 that contains the set difference of the two sequences.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1321 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Except< TSource > ( this IQueryable< TSource >  source1,
IEnumerable< TSource >  source2,
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
source1An T:System.Linq.IQueryable`1 whose elements that are not also in source2 will be returned.
source2An T:System.Collections.Generic.IEnumerable`1 whose elements that also occur in the first sequence will not appear in 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
An T:System.Linq.IQueryable`1 that contains the set difference of the two sequences.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1347 of file Queryable.cs.

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

static TSource System.Linq.Queryable.First< TSource > ( this IQueryable< TSource >  source)
static

Returns the first element of a sequence.

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

Definition at line 1373 of file Queryable.cs.

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

static TSource System.Linq.Queryable.First< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, bool >>  predicate 
)
static

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

Parameters
sourceAn T:System.Linq.IQueryable`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 source that passes the test in predicate .
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 1391 of file Queryable.cs.

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

static TSource System.Linq.Queryable.FirstOrDefault< TSource > ( this IQueryable< TSource >  source)
static

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

Parameters
sourceThe T:System.Linq.IQueryable`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 1416 of file Queryable.cs.

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

static TSource System.Linq.Queryable.FirstOrDefault< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, bool >>  predicate 
)
static

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

Parameters
sourceAn T:System.Linq.IQueryable`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 1434 of file Queryable.cs.

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

static IQueryable<IGrouping<TKey, TSource> > System.Linq.Queryable.GroupBy< TSource, TKey > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TKey >>  keySelector 
)
static

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

Parameters
sourceAn T:System.Linq.IQueryable`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 the function represented in keySelector .
Returns
An IQueryable<IGrouping<TKey, TSource>> in C# or IQueryable(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 876 of file Queryable.cs.

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

static IQueryable<IGrouping<TKey, TSource> > System.Linq.Queryable.GroupBy< TSource, TKey > ( this IQueryable< TSource >  source,
Expression< 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.Linq.IQueryable`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 the function represented in keySelector .
Returns
An IQueryable<IGrouping<TKey, TSource>> in C# or IQueryable(Of IGrouping(Of TKey, TSource)) in Visual Basic where each T:System.Linq.IGrouping`2 contains a sequence of objects and a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or comparer is null.

Definition at line 936 of file Queryable.cs.

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

static IQueryable<IGrouping<TKey, TElement> > System.Linq.Queryable.GroupBy< TSource, TKey, TElement > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TKey >>  keySelector,
Expression< 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.Linq.IQueryable`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.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by the function represented in keySelector .
TElementThe type of the elements in each T:System.Linq.IGrouping`2.
Returns
An IQueryable<IGrouping<TKey, TElement>> in C# or IQueryable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each T:System.Linq.IGrouping`2 contains a sequence of objects of type TElement and a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector is null.

Definition at line 904 of file Queryable.cs.

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

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

Groups the elements of a sequence and projects the elements for each group by using a specified function. Key values are compared by using a specified comparer.

Parameters
sourceAn T:System.Linq.IQueryable`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 the function represented in keySelector .
TElementThe type of the elements in each T:System.Linq.IGrouping`2.
Returns
An IQueryable<IGrouping<TKey, TElement>> in C# or IQueryable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each T:System.Linq.IGrouping`2 contains a sequence of objects of type TElement and a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector or comparer is null.

Definition at line 966 of file Queryable.cs.

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

static IQueryable<TResult> System.Linq.Queryable.GroupBy< TSource, TKey, TElement, TResult > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TKey >>  keySelector,
Expression< Func< TSource, TElement >>  elementSelector,
Expression< 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.Linq.IQueryable`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 the function represented in keySelector .
TElementThe type of the elements in each T:System.Linq.IGrouping`2.
TResultThe type of the result value returned by resultSelector .
Returns
An T:System.Linq.IQueryable`1 that has a type argument of TResult and where each element represents a projection over a group and its key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector or resultSelector is null.

Definition at line 996 of file Queryable.cs.

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

static IQueryable<TResult> System.Linq.Queryable.GroupBy< TSource, TKey, TElement, TResult > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TKey >>  keySelector,
Expression< Func< TSource, TElement >>  elementSelector,
Expression< 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. Keys are compared by using a specified comparer and the elements of each group are projected by using a specified function.

Parameters
sourceAn T:System.Linq.IQueryable`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.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by the function represented in keySelector .
TElementThe type of the elements in each T:System.Linq.IGrouping`2.
TResultThe type of the result value returned by resultSelector .
Returns
An T:System.Linq.IQueryable`1 that has a type argument of TResult and where each element represents a projection over a group and its key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or elementSelector or resultSelector or comparer is null.

Definition at line 1093 of file Queryable.cs.

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

static IQueryable<TResult> System.Linq.Queryable.GroupBy< TSource, TKey, TResult > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TKey >>  keySelector,
Expression< 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.Linq.IQueryable`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 the function represented in keySelector .
TResultThe type of the result value returned by resultSelector .
Returns
An T:System.Linq.IQueryable`1 that has a type argument of TResult and where each element represents a projection over a group and its key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or resultSelector is null.

Definition at line 1028 of file Queryable.cs.

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

static IQueryable<TResult> System.Linq.Queryable.GroupBy< TSource, TKey, TResult > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TKey >>  keySelector,
Expression< 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. Keys are compared by using a specified comparer.

Parameters
sourceAn T:System.Linq.IQueryable`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.
Template Parameters
TSourceThe type of the elements of source .
TKeyThe type of the key returned by the function represented in keySelector .
TResultThe type of the result value returned by resultSelector .
Returns
An T:System.Linq.IQueryable`1 that has a type argument of TResult and where each element represents a projection over a group and its key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or resultSelector or comparer is null.

Definition at line 1062 of file Queryable.cs.

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

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

Correlates the elements of two sequences based on key equality 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.Linq.IQueryable`1 that contains elements of type TResult 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 444 of file Queryable.cs.

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

static IQueryable<TResult> System.Linq.Queryable.GroupJoin< TOuter, TInner, TKey, TResult > ( this IQueryable< TOuter >  outer,
IEnumerable< TInner >  inner,
Expression< Func< TOuter, TKey >>  outerKeySelector,
Expression< Func< TInner, TKey >>  innerKeySelector,
Expression< 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.
comparerA comparer 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.Linq.IQueryable`1 that contains elements of type TResult 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 484 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Intersect< TSource > ( this IQueryable< TSource >  source1,
IEnumerable< TSource >  source2 
)
static

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

Parameters
source1A sequence whose distinct elements that also appear in source2 are returned.
source2A sequence whose distinct elements that also appear in the first sequence are returned.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
A sequence that contains the set intersection of the two sequences.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1269 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Intersect< TSource > ( this IQueryable< TSource >  source1,
IEnumerable< TSource >  source2,
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
source1An T:System.Linq.IQueryable`1 whose distinct elements that also appear in source2 are returned.
source2An T:System.Collections.Generic.IEnumerable`1 whose distinct elements that also appear in the first sequence are returned.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare values.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
An T:System.Linq.IQueryable`1 that contains the set intersection of the two sequences.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1295 of file Queryable.cs.

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

static IQueryable<TResult> System.Linq.Queryable.Join< TOuter, TInner, TKey, TResult > ( this IQueryable< TOuter >  outer,
IEnumerable< TInner >  inner,
Expression< Func< TOuter, TKey >>  outerKeySelector,
Expression< Func< TInner, TKey >>  innerKeySelector,
Expression< 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.Linq.IQueryable`1 that has elements of type TResult 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 365 of file Queryable.cs.

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

static IQueryable<TResult> System.Linq.Queryable.Join< TOuter, TInner, TKey, TResult > ( this IQueryable< TOuter >  outer,
IEnumerable< TInner >  inner,
Expression< Func< TOuter, TKey >>  outerKeySelector,
Expression< Func< TInner, TKey >>  innerKeySelector,
Expression< 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.Linq.IQueryable`1 that has elements of type TResult 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 405 of file Queryable.cs.

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

static TSource System.Linq.Queryable.Last< TSource > ( this IQueryable< TSource >  source)
static

Returns the last element in a sequence.

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

Definition at line 1459 of file Queryable.cs.

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

static TSource System.Linq.Queryable.Last< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, bool >>  predicate 
)
static

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

Parameters
sourceAn T:System.Linq.IQueryable`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 source that passes the test specified by predicate .
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 1477 of file Queryable.cs.

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

static TSource System.Linq.Queryable.LastOrDefault< TSource > ( this IQueryable< TSource >  source)
static

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

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

Definition at line 1502 of file Queryable.cs.

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

static TSource System.Linq.Queryable.LastOrDefault< TSource > ( this IQueryable< TSource >  source,
Expression< 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.Linq.IQueryable`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 elements pass the test in the predicate function; otherwise, the last element of source that passes the test in the predicate function.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 1520 of file Queryable.cs.

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

static long System.Linq.Queryable.LongCount< TSource > ( this IQueryable< TSource >  source)
static

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

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

Definition at line 1947 of file Queryable.cs.

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

static long System.Linq.Queryable.LongCount< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, bool >>  predicate 
)
static

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

Parameters
sourceAn T:System.Linq.IQueryable`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
The number of elements in source that 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 1965 of file Queryable.cs.

◆ Max< TSource >()

static TSource System.Linq.Queryable.Max< TSource > ( this IQueryable< TSource >  source)
static

Returns the maximum value in a generic T:System.Linq.IQueryable`1.

Parameters
sourceA sequence of values to determine the maximum 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 2031 of file Queryable.cs.

◆ Max< TSource, TResult >()

static TResult System.Linq.Queryable.Max< TSource, TResult > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TResult >>  selector 
)
static

Invokes a projection function on each element of a generic T:System.Linq.IQueryable`1 and returns the maximum resulting value.

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

Definition at line 2049 of file Queryable.cs.

◆ Min< TSource >()

static TSource System.Linq.Queryable.Min< TSource > ( this IQueryable< TSource >  source)
static

Returns the minimum value of a generic T:System.Linq.IQueryable`1.

Parameters
sourceA sequence of values to determine the minimum 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 1989 of file Queryable.cs.

◆ Min< TSource, TResult >()

static TResult System.Linq.Queryable.Min< TSource, TResult > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TResult >>  selector 
)
static

Invokes a projection function on each element of a generic T:System.Linq.IQueryable`1 and returns the minimum resulting value.

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

Definition at line 2007 of file Queryable.cs.

◆ OfType< TResult >()

static IQueryable<TResult> System.Linq.Queryable.OfType< TResult > ( this IQueryable  source)
static

Filters the elements of an T:System.Linq.IQueryable based on a specified type.

Parameters
sourceAn T:System.Linq.IQueryable whose elements to filter.
Template Parameters
TResultThe type to filter the elements of the sequence on.
Returns
A collection that contains the elements from source that have type TResult .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 145 of file Queryable.cs.

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

static IOrderedQueryable<TSource> System.Linq.Queryable.OrderBy< TSource, TKey > ( this IQueryable< TSource >  source,
Expression< 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 the function that is represented by keySelector .
Returns
An T:System.Linq.IOrderedQueryable`1 whose elements are sorted according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 518 of file Queryable.cs.

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

static IOrderedQueryable<TSource> System.Linq.Queryable.OrderBy< TSource, TKey > ( this IQueryable< TSource >  source,
Expression< 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 the function that is represented by keySelector .
Returns
An T:System.Linq.IOrderedQueryable`1 whose elements are sorted according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or comparer is null.

Definition at line 545 of file Queryable.cs.

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

static IOrderedQueryable<TSource> System.Linq.Queryable.OrderByDescending< TSource, TKey > ( this IQueryable< TSource >  source,
Expression< 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 the function that is represented by keySelector .
Returns
An T:System.Linq.IOrderedQueryable`1 whose elements are sorted in descending order according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 572 of file Queryable.cs.

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

static IOrderedQueryable<TSource> System.Linq.Queryable.OrderByDescending< TSource, TKey > ( this IQueryable< TSource >  source,
Expression< 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 the function that is represented by keySelector .
Returns
An T:System.Linq.IOrderedQueryable`1 whose elements are sorted in descending order according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or comparer is null.

Definition at line 599 of file Queryable.cs.

◆ Reverse< TSource >()

static IQueryable<TSource> System.Linq.Queryable.Reverse< TSource > ( this IQueryable< 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
An T:System.Linq.IQueryable`1 whose elements correspond to those of the input sequence in reverse order.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 1764 of file Queryable.cs.

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

static IQueryable<TResult> System.Linq.Queryable.Select< TSource, TResult > ( this IQueryable< TSource >  source,
Expression< Func< TSource, TResult >>  selector 
)
static

Projects each element of a sequence into a new form.

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

Definition at line 180 of file Queryable.cs.

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

static IQueryable<TResult> System.Linq.Queryable.Select< TSource, TResult > ( this IQueryable< TSource >  source,
Expression< 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 project.
selectorA projection function to apply to each element.
Template Parameters
TSourceThe type of the elements of source .
TResultThe type of the value returned by the function represented by selector .
Returns
An T:System.Linq.IQueryable`1 whose elements are the result of invoking a projection function on each element of source .
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 206 of file Queryable.cs.

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

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

Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1 that incorporates the index of the source element that produced it. A result selector function is invoked on each element of each intermediate sequence, and the resulting values are combined into a single, one-dimensional sequence and returned.

Parameters
sourceA sequence of values to project.
collectionSelectorA projection function to apply to each element of the input sequence; the second parameter of this function represents the index of the source element.
resultSelectorA projection function to apply to each element of each intermediate sequence.
Template Parameters
TSourceThe type of the elements of source .
TCollectionThe type of the intermediate elements collected by the function represented by collectionSelector .
TResultThe type of the elements of the resulting sequence.
Returns
An T:System.Linq.IQueryable`1 whose elements are the result of invoking the one-to-many projection 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 286 of file Queryable.cs.

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

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

Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1 and invokes a result selector function on each element therein. The resulting values from each intermediate sequence are combined into a single, one-dimensional sequence and returned.

Parameters
sourceA sequence of values to project.
collectionSelectorA projection function to apply to each element of the input sequence.
resultSelectorA projection function to apply to each element of each intermediate sequence.
Template Parameters
TSourceThe type of the elements of source .
TCollectionThe type of the intermediate elements collected by the function represented by collectionSelector .
TResultThe type of the elements of the resulting sequence.
Returns
An T:System.Linq.IQueryable`1 whose elements are the result of invoking the one-to-many projection 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 319 of file Queryable.cs.

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

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

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

Parameters
sourceA sequence of values to project.
selectorA projection 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 the function represented by selector .
Returns
An T:System.Linq.IQueryable`1 whose elements are the result of invoking a one-to-many projection function on each element of the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 232 of file Queryable.cs.

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

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

Projects each element of a sequence to an T:System.Collections.Generic.IEnumerable`1 and combines 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 projection function to apply to each element; the second parameter of this 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 the function represented by selector .
Returns
An T:System.Linq.IQueryable`1 whose elements are the result of invoking a one-to-many projection function on each element of the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource or selector is null.

Definition at line 258 of file Queryable.cs.

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

static bool System.Linq.Queryable.SequenceEqual< TSource > ( this IQueryable< TSource >  source1,
IEnumerable< TSource >  source2 
)
static

Determines whether two sequences are equal by using the default equality comparer to compare elements.

Parameters
source1An T:System.Linq.IQueryable`1 whose elements to compare to those of source2 .
source2An T:System.Collections.Generic.IEnumerable`1 whose elements to compare to those of 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 compare equal; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1782 of file Queryable.cs.

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

static bool System.Linq.Queryable.SequenceEqual< TSource > ( this IQueryable< TSource >  source1,
IEnumerable< TSource >  source2,
IEqualityComparer< TSource >  comparer 
)
static

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

Parameters
source1An T:System.Linq.IQueryable`1 whose elements to compare to those of source2 .
source2An T:System.Collections.Generic.IEnumerable`1 whose elements to compare to those of 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; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1809 of file Queryable.cs.

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

static TSource System.Linq.Queryable.Single< TSource > ( this IQueryable< 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.Linq.IQueryable`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.InvalidOperationExceptionsource has more than one element.

Definition at line 1546 of file Queryable.cs.

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

static TSource System.Linq.Queryable.Single< TSource > ( this IQueryable< TSource >  source,
Expression< 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.Linq.IQueryable`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 in predicate .
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 1564 of file Queryable.cs.

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

static TSource System.Linq.Queryable.SingleOrDefault< TSource > ( this IQueryable< 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.Linq.IQueryable`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.InvalidOperationExceptionsource has more than one element.

Definition at line 1590 of file Queryable.cs.

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

static TSource System.Linq.Queryable.SingleOrDefault< TSource > ( this IQueryable< TSource >  source,
Expression< 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.Linq.IQueryable`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 in predicate , or default(TSource ) if no such element is found.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.
T:System.InvalidOperationExceptionMore than one element satisfies the condition in predicate .

Definition at line 1608 of file Queryable.cs.

◆ Skip< TSource >()

static IQueryable<TSource> System.Linq.Queryable.Skip< TSource > ( this IQueryable< TSource >  source,
int  count 
)
static

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

Parameters
sourceAn T:System.Linq.IQueryable`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.Linq.IQueryable`1 that contains elements that occur after the specified index in the input sequence.
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 804 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.SkipWhile< TSource > ( this IQueryable< TSource >  source,
Expression< 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.Linq.IQueryable`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.Linq.IQueryable`1 that contains elements from source 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 825 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.SkipWhile< TSource > ( this IQueryable< TSource >  source,
Expression< 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.Linq.IQueryable`1 to return elements from.
predicateA function to test each element for a condition; the second parameter of this function represents the index of the source element.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Linq.IQueryable`1 that contains elements from source 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 850 of file Queryable.cs.

◆ Sum() [1/10]

static int System.Linq.Queryable.Sum ( this IQueryable< 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 2073 of file Queryable.cs.

◆ Sum() [2/10]

static ? int System.Linq.Queryable.Sum ( this IQueryable< 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 2089 of file Queryable.cs.

◆ Sum() [3/10]

static long System.Linq.Queryable.Sum ( this IQueryable< 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 2105 of file Queryable.cs.

◆ Sum() [4/10]

static ? long System.Linq.Queryable.Sum ( this IQueryable< 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 2121 of file Queryable.cs.

◆ Sum() [5/10]

static float System.Linq.Queryable.Sum ( this IQueryable< 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 2136 of file Queryable.cs.

◆ Sum() [6/10]

static ? float System.Linq.Queryable.Sum ( this IQueryable< 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 2151 of file Queryable.cs.

◆ Sum() [7/10]

static double System.Linq.Queryable.Sum ( this IQueryable< 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 2166 of file Queryable.cs.

◆ Sum() [8/10]

static ? double System.Linq.Queryable.Sum ( this IQueryable< 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 2181 of file Queryable.cs.

◆ Sum() [9/10]

static decimal System.Linq.Queryable.Sum ( this IQueryable< 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 2197 of file Queryable.cs.

◆ Sum() [10/10]

static ? decimal System.Linq.Queryable.Sum ( this IQueryable< 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 2213 of file Queryable.cs.

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

static int System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, int >>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2231 of file Queryable.cs.

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

static ? int System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, int?>>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2257 of file Queryable.cs.

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

static long System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, long >>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2283 of file Queryable.cs.

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

static ? long System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, long?>>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2309 of file Queryable.cs.

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

static float System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, float >>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2334 of file Queryable.cs.

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

static ? float System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, float?>>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2359 of file Queryable.cs.

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

static double System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, double >>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2384 of file Queryable.cs.

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

static ? double System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, double?>>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2409 of file Queryable.cs.

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

static decimal System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, decimal >>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2435 of file Queryable.cs.

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

static ? decimal System.Linq.Queryable.Sum< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, decimal?>>  selector 
)
static

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

Parameters
sourceA sequence of values of type TSource .
selectorA projection 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 2461 of file Queryable.cs.

◆ Take< TSource >()

static IQueryable<TSource> System.Linq.Queryable.Take< TSource > ( this IQueryable< 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.Linq.IQueryable`1 that contains the specified number of elements from the start of source .
Exceptions
T:System.ArgumentNullExceptionsource is null.

Definition at line 733 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.TakeWhile< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, bool >>  predicate 
)
static

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

Parameters
sourceThe 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.Linq.IQueryable`1 that contains elements from the input sequence occurring before the element at which the test specified by predicate no longer passes.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 754 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.TakeWhile< TSource > ( this IQueryable< TSource >  source,
Expression< 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 element for a condition; the second parameter of the function represents the index of the element in the source sequence.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Linq.IQueryable`1 that contains elements from the input sequence occurring before the element at which the test specified by predicate no longer passes.
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 779 of file Queryable.cs.

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

static IOrderedQueryable<TSource> System.Linq.Queryable.ThenBy< TSource, TKey > ( this IOrderedQueryable< TSource >  source,
Expression< 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.IOrderedQueryable`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 the function represented by keySelector .
Returns
An T:System.Linq.IOrderedQueryable`1 whose elements are sorted according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 626 of file Queryable.cs.

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

static IOrderedQueryable<TSource> System.Linq.Queryable.ThenBy< TSource, TKey > ( this IOrderedQueryable< TSource >  source,
Expression< 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.IOrderedQueryable`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 the function represented by keySelector .
Returns
An T:System.Linq.IOrderedQueryable`1 whose elements are sorted according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or comparer is null.

Definition at line 653 of file Queryable.cs.

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

static IOrderedQueryable<TSource> System.Linq.Queryable.ThenByDescending< TSource, TKey > ( this IOrderedQueryable< TSource >  source,
Expression< 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.IOrderedQueryable`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 the function represented by keySelector .
Returns
An T:System.Linq.IOrderedQueryable`1 whose elements are sorted in descending order according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector is null.

Definition at line 680 of file Queryable.cs.

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

static IOrderedQueryable<TSource> System.Linq.Queryable.ThenByDescending< TSource, TKey > ( this IOrderedQueryable< TSource >  source,
Expression< 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.IOrderedQueryable`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 that is returned by the keySelector function.
Returns
A collection whose elements are sorted in descending order according to a key.
Exceptions
T:System.ArgumentNullExceptionsource or keySelector or comparer is null.

Definition at line 707 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Union< TSource > ( this IQueryable< TSource >  source1,
IEnumerable< TSource >  source2 
)
static

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

Parameters
source1A sequence whose distinct elements form the first set for the union operation.
source2A sequence whose distinct elements form the second set for the union operation.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
An T:System.Linq.IQueryable`1 that contains the elements from both input sequences, excluding duplicates.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1217 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Union< TSource > ( this IQueryable< TSource >  source1,
IEnumerable< TSource >  source2,
IEqualityComparer< TSource >  comparer 
)
static

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

Parameters
source1A sequence whose distinct elements form the first set for the union operation.
source2A sequence whose distinct elements form the second set for the union operation.
comparerAn T:System.Collections.Generic.IEqualityComparer`1 to compare values.
Template Parameters
TSourceThe type of the elements of the input sequences.
Returns
An T:System.Linq.IQueryable`1 that contains the elements from both input sequences, excluding duplicates.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1243 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Where< TSource > ( this IQueryable< TSource >  source,
Expression< Func< TSource, bool >>  predicate 
)
static

Filters a sequence of values based on a predicate.

Parameters
sourceAn T:System.Linq.IQueryable`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.Linq.IQueryable`1 that contains elements from the input sequence that satisfy the condition specified by predicate .
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 96 of file Queryable.cs.

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

static IQueryable<TSource> System.Linq.Queryable.Where< TSource > ( this IQueryable< TSource >  source,
Expression< 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.Linq.IQueryable`1 to filter.
predicateA function to test each element for a condition; the second parameter of the function represents the index of the element in the source sequence.
Template Parameters
TSourceThe type of the elements of source .
Returns
An T:System.Linq.IQueryable`1 that contains elements from the input sequence that satisfy the condition specified by predicate .
Exceptions
T:System.ArgumentNullExceptionsource or predicate is null.

Definition at line 121 of file Queryable.cs.

◆ Zip< TFirst, TSecond, TResult >()

static IQueryable<TResult> System.Linq.Queryable.Zip< TFirst, TSecond, TResult > ( this IQueryable< TFirst >  source1,
IEnumerable< TSecond >  source2,
Expression< Func< TFirst, TSecond, TResult >>  resultSelector 
)
static

Merges two sequences by using the specified predicate function.

Parameters
source1The first sequence to merge.
source2The 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.Linq.IQueryable`1 that contains merged elements of two input sequences.
Exceptions
T:System.ArgumentNullExceptionsource1 or source2 is null.

Definition at line 1187 of file Queryable.cs.


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