System.Core
3.5.0.0
4.0.0.0
System.Object
The methods in this class provide an implementation of the standard query operators for querying data sources that implement . The standard query operators are general purpose methods that follow the vbteclinq pattern and enable you to express traversal, filter, and projection operations over data in any .NET-based programming language.
The majority of the methods in this class are defined as extension methods that extend . This means they can be called like an instance method on any object that implements .
Methods that are used in a query that returns a sequence of values do not consume the target data until the query object is enumerated. This is known as deferred execution. Methods that are used in a query that returns a singleton value execute and consume the target data immediately.
Provides a set of static (Shared in Visual Basic) methods for querying objects that implement .
Method
3.5.0.0
4.0.0.0
TSource
The method makes it simple to perform a calculation over a sequence of values. This method works by calling one time for each element in except the first one. Each time is called, passes both the element from the sequence and an aggregated value (as the first argument to ). The first element of is used as the initial aggregate value. The result of replaces the previous aggregated value. returns the final result of .
This overload of the method isn't suitable for all cases because it uses the first element of as the initial aggregate value. You should choose another overload if the return value should include only the elements of that meet a certain condition. For example, this overload isn't reliable if you want to calculate the sum of the even numbers in . The result will be incorrect if the first element is odd instead of even.
To simplify common aggregation operations, the standard query operators also include a general purpose count method, , and four numeric aggregation methods, namely , , , and .
Applies an accumulator function over a sequence.
The final accumulator value.
An to aggregate over.
An accumulator function to be invoked on each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TAccumulate
The method makes it simple to perform a calculation over a sequence of values. This method works by calling one time for each element in . Each time is called, passes both the element from the sequence and an aggregated value (as the first argument to ). The value of the parameter is used as the initial aggregate value. The result of replaces the previous aggregated value. returns the final result of .
To simplify common aggregation operations, the standard query operators also include a general purpose count method, , and four numeric aggregation methods, namely , , , and .
Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value.
The final accumulator value.
An to aggregate over.
The initial accumulator value.
An accumulator function to be invoked on each element.
The type of the elements of .
The type of the accumulator value.
Method
3.5.0.0
4.0.0.0
TResult
The method makes it simple to perform a calculation over a sequence of values. This method works by calling one time for each element in . Each time is called, passes both the element from the sequence and an aggregated value (as the first argument to ). The value of the parameter is used as the initial aggregate value. The result of replaces the previous aggregated value. The final result of is passed to to obtain the final result of .
To simplify common aggregation operations, the standard query operators also include a general purpose count method, , and four numeric aggregation methods, namely , , , and .
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.
The transformed final accumulator value.
An to aggregate over.
The initial accumulator value.
An accumulator function to be invoked on each element.
A function to transform the final accumulator value into the result value.
The type of the elements of .
The type of the accumulator value.
The type of the resulting value.
Method
3.5.0.0
4.0.0.0
System.Boolean
This method does not return all the elements of a collection. Instead, it determines whether all the elements of a collection satisfy a condition.
The enumeration of is stopped as soon as the result can be determined.
In vbprvb query expression syntax, an Aggregate Into All() clause translates to an invocation of .
Determines whether all elements of a sequence satisfy a condition.
true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.
An that contains the elements to apply the predicate to.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Boolean
This method does not return any one element of a collection. Instead, it determines whether the collection contains any elements.
The enumeration of is stopped as soon as the result can be determined.
In vbprvb query expression syntax, an Aggregate Into Any() clause translates to an invocation of .
Determines whether a sequence contains any elements.
true if the source sequence contains any elements; otherwise, false.
The to check for emptiness.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Boolean
This method does not return any one element of a collection. Instead, it determines whether any elements of a collection satisfy a condition.
The enumeration of is stopped as soon as the result can be determined.
In vbprvb query expression syntax, an Aggregate Into Any() clause translates to an invocation of .
Determines whether any element of a sequence satisfies a condition.
true if any elements in the source sequence pass the test in the specified predicate; otherwise, false.
An whose elements to apply the predicate to.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
The method has no effect other than to change the compile-time type of from a type that implements to itself.
can be used to choose between query implementations when a sequence implements but also has a different set of public query methods available. For example, given a generic class Table that implements and has its own methods such as Where, Select, and SelectMany, a call to Where would invoke the public Where method of Table. A Table type that represents a database table could have a Where method that takes the predicate argument as an expression tree and converts the tree to SQL for remote execution. If remote execution is not desired, for example because the predicate invokes a local method, the method can be used to hide the custom methods and instead make the standard query operators available.
Returns the input typed as .
The input sequence typed as .
The sequence to type as .
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Decimal
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values.
The average of the sequence of values.
A sequence of values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Double
If the sum of the elements is too large to represent as a , this method returns positive or negative infinity.
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values.
The average of the sequence of values.
A sequence of values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Double
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values.
The average of the sequence of values.
A sequence of values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Double
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values.
The average of the sequence of values.
A sequence of values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Decimal>
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of nullable values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
If the sum of the elements is too large to represent as a , this method returns positive or negative infinity.
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of nullable values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of nullable values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of nullable values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Single>
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of nullable values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Single
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values.
The average of the sequence of values.
A sequence of values to calculate the average of.
Method
3.5.0.0
4.0.0.0
System.Decimal
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values.
A sequence of values that are used to calculate an average.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Double
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values.
A sequence of values to calculate the average of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Double
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values.
A sequence of values to calculate the average of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Double
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values.
A sequence of values to calculate the average of.
A transform function to apply to each element.
The type of the elements of source.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Decimal>
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of values to calculate the average of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of values to calculate the average of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of values to calculate the average of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of values to calculate the average of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Single>
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values, or null if the source sequence is empty or contains only values that are null.
A sequence of values to calculate the average of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Single
In vbprvb query expression syntax, an Aggregate Into Average() clause translates to an invocation of .
Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The average of the sequence of values.
A sequence of values to calculate the average of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method enables the standard query operators to be invoked on non-generic collections by supplying the necessary type information. For example, does not implement , but by calling on the object, the standard query operators can then be used to query the sequence.
If an element cannot be cast to type , this method will throw an exception. To obtain only those elements that can be cast to type , use the method instead of .
In a query expression, an explicitly typed iteration variable translates to an invocation of . This example shows the syntax for an explicitly typed range variable.
from int i in objects
From i As Integer In objects
Casts the elements of an to the specified type.
An that contains each element of the source sequence cast to the specified type.
The that contains the elements to be cast to type .
The type to cast the elements of to.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method differs from the method because the method returns all the original elements in the input sequences. The method returns only unique elements.
Concatenates two sequences.
An that contains the concatenated elements of the two input sequences.
The first sequence to concatenate.
The sequence to concatenate to the first sequence.
The type of the elements of the input sequences.
Method
3.5.0.0
4.0.0.0
System.Boolean
If the type of implements , the Contains method in that implementation is invoked to obtain the result. Otherwise, this method determines whether contains the specified element.
Enumeration is terminated as soon as a matching element is found.
Elements are compared to the specified value by using the default equality comparer, .
Determines whether a sequence contains a specified element by using the default equality comparer.
true if the source sequence contains an element that has the specified value; otherwise, false.
A sequence in which to locate a value.
The value to locate in the sequence.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Boolean
Enumeration is terminated as soon as a matching element is found.
If c is null, the default equality comparer, , is used to compare elements to the specified value.
Determines whether a sequence contains a specified element by using a specified .
true if the source sequence contains an element that has the specified value; otherwise, false.
A sequence in which to locate a value.
The value to locate in the sequence.
An equality comparer to compare values.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int32
If the type of implements , that implementation is used to obtain the count of elements. Otherwise, this method determines the count.
Use the method when you expect and want to allow the result to be greater than .
In vbprvb query expression syntax, an Aggregate Into Count() clause translates to an invocation of .
Returns the number of elements in a sequence.
The number of elements in the input sequence.
A sequence that contains elements to be counted.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int32
If the type of implements , that implementation is used to obtain the count of elements. Otherwise, this method determines the count.
You should use the method when you expect and want to allow the result to be greater than .
In vbprvb query expression syntax, an Aggregate Into Count() clause translates to an invocation of .
Returns a number that represents how many elements in the specified sequence satisfy a condition.
A number that represents how many elements in the sequence satisfy the condition in the predicate function.
A sequence that contains elements to be tested and counted.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The default value for reference and nullable types is null.
This method can be used to produce a left outer join when it is combined with the ) method.
Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty.
An object that contains the default value for the type if is empty; otherwise, .
The sequence to return a default value for if it is empty.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
This method can be used to produce a left outer join when it is combined with the ) method.
Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty.
An that contains if is empty; otherwise, .
The sequence to return the specified value for if it is empty.
The value to return if the sequence is empty.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method returns an unordered sequence that contains no duplicate values. It uses the default equality comparer, , to compare values.
In vbprvb query expression syntax, a Distinct clause translates to an invocation of .
The default equality comparer, , is used to compare values of the types that implement the generic interface. To compare a custom data type, you need to implement this interface and provide your own and methods for the type.
For an example that uses to define a custom comparer, see .
Returns distinct elements from a sequence by using the default equality comparer to compare values.
An that contains distinct elements from the source sequence.
The sequence to remove duplicate elements from.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method returns an unordered sequence that contains no duplicate values. If c is null, the default equality comparer, , is used to compare values.
Returns distinct elements from a sequence by using a specified to compare values.
An that contains distinct elements from the source sequence.
The sequence to remove duplicate elements from.
An to compare values.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
If the type of implements , that implementation is used to obtain the element at the specified index. Otherwise, this method obtains the specified element.
This method throws an exception if is out of range. To instead return a default value when the specified index is out of range, use the method.
Returns the element at a specified index in a sequence.
The element at the specified position in the source sequence.
An to return an element from.
The zero-based index of the element to retrieve.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
If the type of implements , that implementation is used to obtain the element at the specified index. Otherwise, this method obtains the specified element.
The default value for reference and nullable types is null.
Returns the element at a specified index in a sequence or a default value if the index is out of range.
default() if the index is outside the bounds of the source sequence; otherwise, the element at the specified position in the source sequence.
An to return an element from.
The zero-based index of the element to retrieve.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
The method caches an empty sequence of type . When the object it returns is enumerated, it yields no elements.
In some cases, this method is useful for passing an empty sequence to a user-defined method that takes an . It can also be used to generate a neutral element for methods such as . See the Example section for an example of this use of .
Returns an empty that has the specified type argument.
An empty whose type argument is .
The type to assign to the type parameter of the returned generic .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The set difference of two sets is defined as the members of the first set that do not appear in the second set.
This method returns those elements in that do not appear in . It does not also return those elements in that do not appear in .
The default equality comparer, , is used to compare values of the types that implement the generic interface. To compare a custom data type, you need to implement this interface and provide your own and methods for the type.
Produces the set difference of two sequences by using the default equality comparer to compare values.
A sequence that contains the set difference of the elements of two sequences.
An whose elements that are not also in will be returned.
An whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence.
The type of the elements of the input sequences.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
If c is null, the default equality comparer, , is used to compare values.
Produces the set difference of two sequences by using the specified to compare values.
A sequence that contains the set difference of the elements of two sequences.
An whose elements that are not also in will be returned.
An whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence.
An to compare values.
The type of the elements of the input sequences.
Method
3.5.0.0
4.0.0.0
TSource
The method throws an exception if contains no elements. To instead return a default value when the source sequence is empty, use the method.
Returns the first element of a sequence.
The first element in the specified sequence.
The to return the first element of.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
The method throws an exception if no matching element is found in . To instead return a default value when no matching element is found, use the method.
Returns the first element in a sequence that satisfies a specified condition.
The first element in the sequence that passes the test in the specified predicate function.
An to return an element from.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
The default value for reference and nullable types is null.
The method does not provide a way to specify a default value. If you want to specify a default value other than default(), use the method as described in the Example section.
Returns the first element of a sequence, or a default value if the sequence contains no elements.
default() if is empty; otherwise, the first element in .
The to return the first element of.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
The default value for reference and nullable types is null.
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
default() if is empty or if no element passes the test specified by ; otherwise, the first element in that passes the test specified by .
An to return an element from.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<System.Linq.IGrouping<TKey,TSource>>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
For examples of GroupBy, see the following topics.
-
-
-
The method returns a collection of objects, one for each distinct key that was encountered. An is an that also has a key associated with its elements.
The objects are yielded in an order based on the order of the elements in that produced the first key of each . Elements in a grouping are yielded in the order they appear in .
The default equality comparer is used to compare keys.
In query expression syntax, a group by (csprcs) or Group By Into (vbprvb) clause translates to an invocation of . For more information and usage examples, see group clause (C# Reference) and Group By Clause (Visual Basic).
Groups the elements of a sequence according to a specified key selector function.
An IEnumerable<IGrouping<TKey, TSource>> in C# or IEnumerable(Of IGrouping(Of TKey, TSource)) in vbprvb where each object contains a sequence of objects and a key.
An whose elements to group.
A function to extract the key for each element.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<System.Linq.IGrouping<TKey,TSource>>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
For examples of GroupBy, see the following topics.
-
-
-
The method returns a collection of objects, one for each distinct key that was encountered. An is an that also has a key associated with its elements.
The objects are yielded in an order based on the order of the elements in that produced the first key of each . Elements in a grouping are yielded in the order they appear in .
If is null, the default equality comparer is used to compare keys.
If two keys are considered equal according to , the first key is chosen as the key for that grouping.
In query expression syntax, a group by (csprcs) or Group By Into (vbprvb) clause translates to an invocation of . For more information and usage examples, see group clause (C# Reference) and Group By Clause (Visual Basic).
Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer.
An IEnumerable<IGrouping<TKey, TSource>> in C# or IEnumerable(Of IGrouping(Of TKey, TSource)) in vbprvb where each object contains a collection of objects and a key.
An whose elements to group.
A function to extract the key for each element.
An to compare keys.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<System.Linq.IGrouping<TKey,TElement>>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method returns a collection of objects, one for each distinct key that was encountered. An is an that also has a key associated with its elements.
The objects are yielded in an order based on the order of the elements in that produced the first key of each . Elements in a grouping are yielded in the order that the elements that produced them appear in .
The default equality comparer is used to compare keys.
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.
An IEnumerable<IGrouping<TKey, TElement>> in C# or IEnumerable(Of IGrouping(Of TKey, TElement)) in vbprvb where each object contains a collection of objects of type and a key.
An whose elements to group.
A function to extract the key for each element.
A function to map each source element to an element in the .
The type of the elements of .
The type of the key returned by .
The type of the elements in the .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<System.Linq.IGrouping<TKey,TElement>>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
For examples of GroupBy, see the following topics.
-
-
-
The method returns a collection of objects, one for each distinct key that was encountered. An is an that also has a key associated with its elements.
The objects are yielded in an order based on the order of the elements in that produced the first key of each . Elements in a grouping are yielded in the order that the elements that produced them appear in .
If is null, the default equality comparer is used to compare keys.
If two keys are considered equal according to , the first key is chosen as the key for that grouping.
In query expression syntax, a group by (csprcs) or Group By Into (vbprvb) clause translates to an invocation of . For more information and usage examples, see group clause (C# Reference) and Group By Clause (Visual Basic).
Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function.
An IEnumerable<IGrouping<TKey, TElement>> in C# or IEnumerable(Of IGrouping(Of TKey, TElement)) in vbprvb where each object contains a collection of objects of type and a key.
An whose elements to group.
A function to extract the key for each element.
A function to map each source element to an element in an .
An to compare keys.
The type of the elements of .
The type of the key returned by .
The type of the elements in the .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
In query expression syntax, a group by (csprcs) or Group By Into (vbprvb) clause translates to an invocation of .
Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key.
A collection of elements of type where each element represents a projection over a group and its key.
An whose elements to group.
A function to extract the key for each element.
A function to create a result value from each group.
The type of the elements of .
The type of the key returned by .
The type of the result value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
To be added.
Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer.
A collection of elements of type where each element represents a projection over a group and its key.
An whose elements to group.
A function to extract the key for each element.
A function to create a result value from each group.
An to compare keys with.
The type of the elements of .
The type of the key returned by .
The type of the result value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
In query expression syntax, a group by (csprcs) or Group By Into (vbprvb) clause translates to an invocation of .
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.
A collection of elements of type where each element represents a projection over a group and its key.
An whose elements to group.
A function to extract the key for each element.
A function to map each source element to an element in an .
A function to create a result value from each group.
The type of the elements of .
The type of the key returned by .
The type of the elements in each .
The type of the result value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
To be added.
Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function.
A collection of elements of type where each element represents a projection over a group and its key.
An whose elements to group.
A function to extract the key for each element.
A function to map each source element to an element in an .
A function to create a result value from each group.
An to compare keys with.
The type of the elements of .
The type of the key returned by .
The type of the elements in each .
The type of the result value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The default equality comparer, , is used to hash and compare keys.
produces hierarchical results, which means that elements from are paired with collections of matching elements from . GroupJoin enables you to base your results on a whole set of matches for each element of .
If there are no correlated elements in for a given element of , the sequence of matches for that element will be empty but will still appear in the results.
The function is called only one time for each element together with a collection of all the elements that match the element. This differs from the method, in which the result selector function is invoked on pairs that contain one element from and one element from .
GroupJoin preserves the order of the elements of , and for each element of , the order of the matching elements from .
has no direct equivalent in traditional relational database terms. However, this method does implement a superset of inner joins and left outer joins. Both of these operations can be written in terms of a grouped join. See Join Operations.
In query expression syntax, a join … into (csprcs) or Group Join (vbprvb) clause translates to an invocation of .
Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys.
An that contains elements of type that are obtained by performing a grouped join on two sequences.
The first sequence to join.
The sequence to join to the first sequence.
A function to extract the join key from each element of the first sequence.
A function to extract the join key from each element of the second sequence.
A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.
The type of the elements of the first sequence.
The type of the elements of the second sequence.
The type of the keys returned by the key selector functions.
The type of the result elements.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
If c is null, the default equality comparer, , is used to hash and compare keys.
produces hierarchical results, which means that elements from are paired with collections of matching elements from . GroupJoin enables you to base your results on a whole set of matches for each element of .
If there are no correlated elements in for a given element of , the sequence of matches for that element will be empty but will still appear in the results.
The function is called only one time for each element together with a collection of all the elements that match the element. This differs from the method in which the result selector function is invoked on pairs that contain one element from and one element from .
GroupJoin preserves the order of the elements of , and for each element of , the order of the matching elements from .
has no direct equivalent in traditional relational database terms. However, this method does implement a superset of inner joins and left outer joins. Both of these operations can be written in terms of a grouped join. See Performing Join Operations.
Correlates the elements of two sequences based on key equality and groups the results. A specified is used to compare keys.
An that contains elements of type that are obtained by performing a grouped join on two sequences.
The first sequence to join.
The sequence to join to the first sequence.
A function to extract the join key from each element of the first sequence.
A function to extract the join key from each element of the second sequence.
A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence.
An to hash and compare keys.
The type of the elements of the first sequence.
The type of the elements of the second sequence.
The type of the keys returned by the key selector functions.
The type of the result elements.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The intersection of two sets A and B is defined as the set that contains all the elements of A that also appear in B, but no other elements.
When the object returned by this method is enumerated, enumerates , collecting all distinct elements of that sequence. It then enumerates , marking those elements that occur in both sequences. Finally, the marked elements are yielded in the order in which they were collected.
The default equality comparer, , is used to compare values of the types that implement the generic interface. To compare a custom data type, you need to implement this interface and provide your own and methods for the type.
Produces the set intersection of two sequences by using the default equality comparer to compare values.
A sequence that contains the elements that form the set intersection of two sequences.
An whose distinct elements that also appear in will be returned.
An whose distinct elements that also appear in the first sequence will be returned.
The type of the elements of the input sequences.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The intersection of two sets A and B is defined as the set that contains all the elements of A that also appear in B, but no other elements.
When the object returned by this method is enumerated, enumerates , collecting all distinct elements of that sequence. It then enumerates , marking those elements that occur in both sequences. Finally, the marked elements are yielded in the order in which they were collected.
If c is null, the default equality comparer, , is used to compare values.
Produces the set intersection of two sequences by using the specified to compare values.
A sequence that contains the elements that form the set intersection of two sequences.
An whose distinct elements that also appear in will be returned.
An whose distinct elements that also appear in the first sequence will be returned.
An to compare values.
The type of the elements of the input sequences.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The default equality comparer, , is used to hash and compare keys.
A join refers to the operation of correlating the elements of two sources of information based on a common key. brings the two information sources and the keys by which they are matched together in one method call. This differs from the use of SelectMany, which requires more than one method call to perform the same operation.
preserves the order of the elements of , and for each of these elements, the order of the matching elements of .
In query expression syntax, a join (csprcs) or Join (vbprvb) clause translates to an invocation of .
In relational database terms, the method implements an inner equijoin. 'Inner' means that only elements that have a match in the other sequence are included in the results. An 'equijoin' is a join in which the keys are compared for equality. A left outer join operation has no dedicated standard query operator, but can be performed by using the method. See Joining.
Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys.
An that has elements of type that are obtained by performing an inner join on two sequences.
The first sequence to join.
The sequence to join to the first sequence.
A function to extract the join key from each element of the first sequence.
A function to extract the join key from each element of the second sequence.
A function to create a result element from two matching elements.
The type of the elements of the first sequence.
The type of the elements of the second sequence.
The type of the keys returned by the key selector functions.
The type of the result elements.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
If c is null, the default equality comparer, , is used to hash and compare keys.
A join refers to the operation of correlating the elements of two sources of information based on a common key. brings the two information sources and the keys by which they are matched together in one method call. This differs from the use of SelectMany, which requires more than one method call to perform the same operation.
preserves the order of the elements of , and for each of these elements, the order of the matching elements of .
In relational database terms, the method implements an inner equijoin. 'Inner' means that only elements that have a match in the other sequence are included in the results. An 'equijoin' is a join in which the keys are compared for equality. A left outer join operation has no dedicated standard query operator, but can be performed by using the method. See Joining.
Correlates the elements of two sequences based on matching keys. A specified is used to compare keys.
An that has elements of type that are obtained by performing an inner join on two sequences.
The first sequence to join.
The sequence to join to the first sequence.
A function to extract the join key from each element of the first sequence.
A function to extract the join key from each element of the second sequence.
A function to create a result element from two matching elements.
An to hash and compare keys.
The type of the elements of the first sequence.
The type of the elements of the second sequence.
The type of the keys returned by the key selector functions.
The type of the result elements.
Method
3.5.0.0
4.0.0.0
TSource
The method throws an exception if contains no elements. To instead return a default value when the source sequence is empty, use the method.
Returns the last element of a sequence.
The value at the last position in the source sequence.
An to return the last element of.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
The method throws an exception if no matching element is found in . To instead return a default value when no matching element is found, use the method.
Returns the last element of a sequence that satisfies a specified condition.
The last element in the sequence that passes the test in the specified predicate function.
An to return an element from.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
The default value for reference and nullable types is null.
The method does not provide a way to specify a default value. If you want to specify a default value other than default(), use the method as described in the Example section.
Returns the last element of a sequence, or a default value if the sequence contains no elements.
default() if the source sequence is empty; otherwise, the last element in the .
An to return the last element of.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
The default value for reference and nullable types is null.
Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.
default() if the sequence is empty or if no elements pass the test in the predicate function; otherwise, the last element that passes the test in the predicate function.
An to return an element from.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int64
Use this method rather than when you expect the result to be greater than .
In vbprvb query expression syntax, an Aggregate Into LongCount() clause translates to an invocation of .
Returns an that represents the total number of elements in a sequence.
The number of elements in the source sequence.
An that contains the elements to be counted.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int64
Use this method rather than when you expect the result to be greater than .
In vbprvb query expression syntax, an Aggregate Into LongCount() clause translates to an invocation of .
Returns an that represents how many elements in a sequence satisfy a condition.
A number that represents how many elements in the sequence satisfy the condition in the predicate function.
An that contains the elements to be counted.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Decimal
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of values.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
System.Double
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of values.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
System.Int32
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of values.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
System.Int64
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of values.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Decimal>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of nullable values.
A value of type Nullable<Decimal> in C# or Nullable(Of Decimal) in vbprvb that corresponds to the maximum value in the sequence.Â
A sequence of nullable values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of nullable values.
A value of type Nullable<Double> in C# or Nullable(Of Double) in vbprvb that corresponds to the maximum value in the sequence.
A sequence of nullable values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int32>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of nullable values.
A value of type Nullable<Int32> in C# or Nullable(Of Int32) in vbprvb that corresponds to the maximum value in the sequence.Â
A sequence of nullable values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int64>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of nullable values.
A value of type Nullable<Int64> in C# or Nullable(Of Int64) in vbprvb that corresponds to the maximum value in the sequence.Â
A sequence of nullable values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Single>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of nullable values.
A value of type Nullable<Single> in C# or Nullable(Of Single) in vbprvb that corresponds to the maximum value in the sequence.
A sequence of nullable values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
System.Single
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a sequence of values.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
Method
3.5.0.0
4.0.0.0
TSource
If type implements , the method uses that implementation to compare values. Otherwise, if type implements , that implementation is used to compare values.
If is a reference type and the source sequence is empty or contains only values that are null, this method returns null.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Returns the maximum value in a generic sequence.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Decimal
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum value.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Double
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum value.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int32
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum value.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int64
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum value.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Decimal>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Decimal> in C# or Nullable(Of Decimal) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum nullable value.
The value of type Nullable<Decimal> in C# or Nullable(Of Decimal) in vbprvb that corresponds to the maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Double> in C# or Nullable(Of Double) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum nullable value.
The value of type Nullable<Double> in C# or Nullable(Of Double) in vbprvb that corresponds to the maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int32>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Int32> in C# or Nullable(Of Int32) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum nullable value.
The value of type Nullable<Int32> in C# or Nullable(Of Int32) in vbprvb that corresponds to the maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int64>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Int64> in C# or Nullable(Of Int64) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum nullable value.
The value of type Nullable<Int64> in C# or Nullable(Of Int64) in vbprvb that corresponds to the maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Single>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Single> in C# or Nullable(Of Single) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum nullable value.
The value of type Nullable<Single> in C# or Nullable(Of Single) in vbprvb that corresponds to the maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Single
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the maximum value.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TResult
If type implements , this method uses that implementation to compare values. Otherwise, if type implements , that implementation is used to compare values.
In vbprvb query expression syntax, an Aggregate Into Max() clause translates to an invocation of .
Invokes a transform function on each element of a generic sequence and returns the maximum resulting value.
The maximum value in the sequence.
A sequence of values to determine the maximum value of.
A transform function to apply to each element.
The type of the elements of .
The type of the value returned by .
Method
3.5.0.0
4.0.0.0
System.Decimal
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of values.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
System.Double
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of values.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
System.Int32
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of values.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
System.Int64
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of values.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Decimal>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of nullable values.
A value of type Nullable<Decimal> in C# or Nullable(Of Decimal) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of nullable values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of nullable values.
A value of type Nullable<Double> in C# or Nullable(Of Double) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of nullable values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int32>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of nullable values.
A value of type Nullable<Int32> in C# or Nullable(Of Int32) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of nullable values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int64>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of nullable values.
A value of type Nullable<Int64> in C# or Nullable(Of Int64) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of nullable values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Single>
The method uses the implementation of to compare values.
If the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of nullable values.
A value of type Nullable<Single> in C# or Nullable(Of Single) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of nullable values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
System.Single
The method uses the implementation of to compare values.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a sequence of values.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
Method
3.5.0.0
4.0.0.0
TSource
If type implements , this method uses that implementation to compare values. Otherwise, if type implements , that implementation is used to compare values.
If is a reference type and the source sequence is empty or contains only values that are null, this function returns null.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Returns the minimum value in a generic sequence.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Decimal
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum value.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Double
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum value.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int32
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum value.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int64
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum value.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Decimal>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Decimal> in C# or Nullable(Of Decimal) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum nullable value.
The value of type Nullable<Decimal> in C# or Nullable(Of Decimal) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Double> in C# or Nullable(Of Double) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum nullable value.
The value of type Nullable<Double> in C# or Nullable(Of Double) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int32>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of source into a numeric type, specifically Nullable<Int32> in C# or Nullable(Of Int32) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum nullable value.
The value of type Nullable<Int32> in C# or Nullable(Of Int32) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int64>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Int64> in C# or Nullable(Of Int64) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum nullable value.
The value of type Nullable<Int64> in C# or Nullable(Of Int64) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Single>
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Single> in C# or Nullable(Of Single) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum nullable value.
The value of type Nullable<Single> in C# or Nullable(Of Single) in vbprvb that corresponds to the minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Single
The method uses the implementation of to compare values.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a sequence and returns the minimum value.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TResult
If type implements , this method uses that implementation to compare values. Otherwise, if type implements , that implementation is used to compare values.
In vbprvb query expression syntax, an Aggregate Into Min() clause translates to an invocation of .
Invokes a transform function on each element of a generic sequence and returns the minimum resulting value.
The minimum value in the sequence.
A sequence of values to determine the minimum value of.
A transform function to apply to each element.
The type of the elements of .
The type of the value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method returns only those elements in that can be cast to type . To instead receive an exception if an element cannot be cast to type , use .
This method is one of the few standard query operator methods that can be applied to a collection that has a non-parameterized type, such as an . This is because extends the type . cannot only be applied to collections that are based on the parameterized type, but collections that are based on the non-parameterized type also.
By applying to a collection that implements , you gain the ability to query the collection by using the standard query operators. For example, specifying a type argument of to would return an object of type IEnumerable<Object> in C# or IEnumerable(Of Object) in vbprvb, to which the standard query operators can be applied.
Filters the elements of an based on a specified type.
An that contains elements from the input sequence of type .
The whose elements to filter.
The type to filter the elements of the sequence on.
Method
3.5.0.0
4.0.0.0
System.Linq.IOrderedEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
To order a sequence by the values of the elements themselves, specify the identity function (x => x in csprcs or Function(x) x in vbprvb) for .
Two methods are defined to extend the type , which is the return type of this method. These two methods, namely ThenBy and ThenByDescending, enable you to specify additional sort criteria to sort a sequence. ThenBy and ThenByDescending also return an , which means any number of consecutive calls to ThenBy or ThenByDescending can be made.
Because inherits from , you can call or on the results of a call to , , or . Doing this introduces a new primary ordering that ignores the previously established ordering.
This method compares keys by using the default comparer .
This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key.
In query expression syntax, an orderby (csprcs) or Order By (vbprvb) clause translates to an invocation of .
Sorts the elements of a sequence in ascending order according to a key.
An whose elements are sorted according to a key.
A sequence of values to order.
A function to extract a key from an element.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Linq.IOrderedEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
To order a sequence by the values of the elements themselves, specify the identity function (x => x in csprcs or Function(x) x in vbprvb) for .
Two methods are defined to extend the type , which is the return type of this method. These two methods, namely ThenBy and ThenByDescending, enable you to specify additional sort criteria to sort a sequence. ThenBy and ThenByDescending also return an , which means any number of consecutive calls to ThenBy or ThenByDescending can be made.
Because inherits from , you can call or on the results of a call to , , or . Doing this introduces a new primary ordering that ignores the previously established ordering.
If is null, the default comparer is used to compare keys.
This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key.
Sorts the elements of a sequence in ascending order by using a specified comparer.
An whose elements are sorted according to a key.
A sequence of values to order.
A function to extract a key from an element.
An to compare keys.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Linq.IOrderedEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
To order a sequence by the values of the elements themselves, specify the identity function (x => x in csprcs or Function(x) x in vbprvb) for .
For an example of this method, see .
Two methods are defined to extend the type , which is the return type of this method. These two methods, namely ThenBy and ThenByDescending, enable you to specify additional sort criteria to sort a sequence. ThenBy and ThenByDescending also return an , which means any number of consecutive calls to ThenBy or ThenByDescending can be made.
Because inherits from , you can call or on the results of a call to , , or . Doing this introduces a new primary ordering that ignores the previously established ordering.
This method compares keys by using the default comparer .
This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key.
In query expression syntax, an orderby descending (csprcs) or Order By Descending (vbprvb) clause translates to an invocation of .
Sorts the elements of a sequence in descending order according to a key.
An whose elements are sorted in descending order according to a key.
A sequence of values to order.
A function to extract a key from an element.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Linq.IOrderedEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
To order a sequence by the values of the elements themselves, specify the identity function (x => x in csprcs or Function(x) x in vbprvb) for .
Two methods are defined to extend the type , which is the return type of this method. These two methods, namely ThenBy and ThenByDescending, enable you to specify additional sort criteria to sort a sequence. ThenBy and ThenByDescending also return an , which means any number of consecutive calls to ThenBy or ThenByDescending can be made.
Because inherits from , you can call or on the results of a call to , , or . Doing this introduces a new primary ordering that ignores the previously established ordering.
If is null, the default comparer is used to compare keys.
This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key.
Sorts the elements of a sequence in descending order by using a specified comparer.
An whose elements are sorted in descending order according to a key.
A sequence of values to order.
A function to extract a key from an element.
An to compare keys.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<System.Int32>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
Generates a sequence of integral numbers within a specified range.
An IEnumerable<Int32> in C# or IEnumerable(Of Int32) in vbprvb that contains a range of sequential integral numbers.
The value of the first integer in the sequence.
The number of sequential integers to generate.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
To be added.
To be added.
To be added.
To be added.
To be added.
To be added.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
Unlike , this sorting method does not consider the actual values themselves in determining the order. Rather, it just returns the elements in the reverse order from which they are produced by the underlying source.
Inverts the order of the elements in a sequence.
A sequence whose elements correspond to those of the input sequence in reverse order.
A sequence of values to reverse.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The first argument to represents the element to process. The second argument to represents the zero-based index of that element in the source sequence. This can be useful if the elements are in a known order and you want to do something with an element at a particular index, for example. It can also be useful if you want to retrieve the index of one or more elements.
This projection method requires the transform function, , to produce one value for each value in the source sequence, . If returns a value that is itself a collection, it is up to the consumer to traverse the subsequences manually. In such a situation, it might be better for your query to return a single coalesced sequence of values. To achieve this, use the method instead of . Although SelectMany works similarly to Select, it differs in that the transform function returns a collection that is then expanded by SelectMany before it is returned.
Projects each element of a sequence into a new form by incorporating the element's index.
An whose elements are the result of invoking the transform function on each element of .
A sequence of values to invoke a transform function on.
A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
The type of the elements of .
The type of the value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
This projection method requires the transform function, , to produce one value for each value in the source sequence, . If returns a value that is itself a collection, it is up to the consumer to traverse the subsequences manually. In such a situation, it might be better for your query to return a single coalesced sequence of values. To achieve this, use the method instead of . Although SelectMany works similarly to Select, it differs in that the transform function returns a collection that is then expanded by SelectMany before it is returned.
In query expression syntax, a select (csprcs) or Select (vbprvb) clause translates to an invocation of .
Projects each element of a sequence into a new form.
An whose elements are the result of invoking the transform function on each element of .
A sequence of values to invoke a transform function on.
A transform function to apply to each element.
The type of the elements of .
The type of the value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method enumerates the input sequence, uses a transform function to map each element to an , and then enumerates and yields the elements of each such object. That is, for each element of , is invoked and a sequence of values is returned. then flattens this two-dimensional collection of collections into a one-dimensional and returns it. For example, if a query uses to obtain the orders (of type Order) for each customer in a database, the result is of type IEnumerable<Order> in C# or IEnumerable(Of Order) in vbprvb. If instead the query uses to obtain the orders, the collection of collections of orders is not combined and the result is of type IEnumerable<List<Order>> in C# or IEnumerable(Of List(Of Order)) in vbprvb.
In query expression syntax, each from clause (csprcs) or From clause (vbprvb) after the initial one translates to an invocation of .
Projects each element of a sequence to an and flattens the resulting sequences into one sequence.
An whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.
A sequence of values to project.
A transform function to apply to each element.
The type of the elements of .
The type of the elements of the sequence returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method enumerates the input sequence, uses a transform function to map each element to an , and then enumerates and yields the elements of each such object. That is, for each element of , is invoked and a sequence of values is returned. then flattens this two-dimensional collection of collections into a one-dimensional and returns it. For example, if a query uses to obtain the orders (of type Order) for each customer in a database, the result is of type IEnumerable<Order> in C# or IEnumerable(Of Order) in vbprvb. If instead the query uses to obtain the orders, the collection of collections of orders is not combined and the result is of type IEnumerable<List<Order>> in C# or IEnumerable(Of List(Of Order)) in vbprvb.
The first argument to represents the element to process. The second argument to represents the zero-based index of that element in the source sequence. This can be useful if the elements are in a known order and you want to do something with an element at a particular index, for example. It can also be useful if you want to retrieve the index of one or more elements.
Projects each element of a sequence to an , and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element.
An whose elements are the result of invoking the one-to-many transform function on each element of an input sequence.
A sequence of values to project.
A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
The type of the elements of .
The type of the elements of the sequence returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method is useful when you have to keep the elements of in scope for query logic that occurs after the call to . See the Example section for a code example. If there is a bidirectional relationship between objects of type and objects of type , that is, if an object of type provides a property to retrieve the object that produced it, you do not need this overload of . Instead, you can use and navigate back to the object through the object.
In query expression syntax, each from clause (csprcs) or From clause (vbprvb) after the initial one translates to an invocation of .
Projects each element of a sequence to an , flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein.
An whose elements are the result of invoking the one-to-many transform function on each element of and then mapping each of those sequence elements and their corresponding source element to a result element.
A sequence of values to project.
A transform function to apply to each element of the input sequence.
A transform function to apply to each element of the intermediate sequence.
The type of the elements of .
The type of the intermediate elements collected by .
The type of the elements of the resulting sequence.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method is useful when you have to keep the elements of in scope for query logic that occurs after the call to . See the Example section for a code example. If there is a bidirectional relationship between objects of type and objects of type , that is, if an object of type provides a property to retrieve the object that produced it, you do not need this overload of . Instead, you can use and navigate back to the object through the object.
Projects each element of a sequence to an , flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element.
An whose elements are the result of invoking the one-to-many transform function on each element of and then mapping each of those sequence elements and their corresponding source element to a result element.
A sequence of values to project.
A transform function to apply to each source element; the second parameter of the function represents the index of the source element.
A transform function to apply to each element of the intermediate sequence.
The type of the elements of .
The type of the intermediate elements collected by .
The type of the elements of the resulting sequence.
Method
3.5.0.0
4.0.0.0
System.Boolean
The method enumerates the two source sequences in parallel and compares corresponding elements by using the default equality comparer for , . The default equality comparer, , is used to compare values of the types that implement the generic interface. To compare a custom data type, you need to implement this interface and provide your own and methods for the type.
Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type.
true if the two source sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type; otherwise, false.
An to compare to .
An to compare to the first sequence.
The type of the elements of the input sequences.
Method
3.5.0.0
4.0.0.0
System.Boolean
The method enumerates the two source sequences in parallel and compares corresponding elements by using the specified . If c is null, the default equality comparer, , is used to compare elements.
Determines whether two sequences are equal by comparing their elements by using a specified .
true if the two source sequences are of equal length and their corresponding elements compare equal according to ; otherwise, false.
An to compare to .
An to compare to the first sequence.
An to use to compare elements.
The type of the elements of the input sequences.
Method
3.5.0.0
4.0.0.0
TSource
The method throws an exception if the input sequence is empty. To instead return null when the input sequence is empty, use .
Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
The single element of the input sequence.
An to return the single element of.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
The method throws an exception if the input sequence contains no matching element. To instead return null when no matching element is found, use .
Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
The single element of the input sequence that satisfies a condition.
An to return a single element from.
A function to test an element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
The default value for reference and nullable types is null.
The method does not provide a way to specify a default value. If you want to specify a default value other than default(), use the method as described in the Example section.
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.
The single element of the input sequence, or default() if the sequence contains no elements.
An to return the single element of.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
TSource
The default value for reference and nullable types is null.
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.
The single element of the input sequence that satisfies the condition, or default() if no such element is found.
An to return a single element from.
A function to test an element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
If contains fewer than elements, an empty is returned. If is less than or equal to zero, all elements of are yielded.
The and methods are functional complements. Given a sequence coll and an integer n, concatenating the results of coll.Take(n) and coll.Skip(n) yields the same sequence as coll.
In vbprvb query expression syntax, a Skip clause translates to an invocation of .
Bypasses a specified number of elements in a sequence and then returns the remaining elements.
An that contains the elements that occur after the specified index in the input sequence.
An to return elements from.
The number of elements to skip before returning the remaining elements.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
The method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
This method tests each element of by using and skips the element if the result is true. After the predicate function returns false for an element, that element and the remaining elements in are yielded and there are no more invocations of .
If returns true for all elements in the sequence, an empty is returned.
The and methods are functional complements. Given a sequence coll and a pure function p, concatenating the results of coll.TakeWhile(p) and coll.SkipWhile(p) yields the same sequence as coll.
In vbprvb query expression syntax, a Skip While clause translates to an invocation of .
Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.
An that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by .
An to return elements from.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method tests each element of by using and skips the element if the result is true. After the predicate function returns false for an element, that element and the remaining elements in are yielded and there are no more invocations of .
If returns true for all elements in the sequence, an empty is returned.
The first argument of represents the element to test. The second argument represents the zero-based index of the element within .
The and methods are functional complements. Given a sequence coll and a pure function p, concatenating the results of coll.TakeWhile(p) and coll.SkipWhile(p) yields the same sequence as coll.
In vbprvb query expression syntax, a Skip While clause translates to an invocation of .
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.
An that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by .
An to return elements from.
A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Decimal
The method returns zero if contains no elements.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of values.
The sum of the values in the sequence.
A sequence of values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Double
This method returns zero if contains no elements.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of values.
The sum of the values in the sequence.
A sequence of values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Int32
This method returns zero if contains no elements.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of values.
The sum of the values in the sequence.
A sequence of values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Int64
This method returns zero if contains no elements.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of values.
The sum of the values in the sequence.
A sequence of values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Decimal>
This method returns zero if contains no elements.
The result does not include values that are null.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of nullable values.
The sum of the values in the sequence.
A sequence of nullable values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
This method returns zero if contains no elements.
The result does not include values that are null.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of nullable values.
The sum of the values in the sequence.
A sequence of nullable values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int32>
This method returns zero if contains no elements.
The result does not include values that are null.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of nullable values.
The sum of the values in the sequence.
A sequence of nullable values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int64>
This method returns zero if contains no elements.
The result does not include values that are null.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of nullable values.
The sum of the values in the sequence.
A sequence of nullable values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Single>
This method returns zero if contains no elements.
The result does not include values that are null.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of nullable values.
The sum of the values in the sequence.
A sequence of nullable values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Single
This method returns zero if contains no elements.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of a sequence of values.
The sum of the values in the sequence.
A sequence of values to calculate the sum of.
Method
3.5.0.0
4.0.0.0
System.Decimal
This method returns zero if contains no elements.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Double
This method returns zero if contains no elements.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int32
This method returns zero if contains no elements.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Int64
This method returns zero if contains no elements.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Decimal>
This method returns zero if contains no elements.
The result does not included values that are null.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Decimal> in C# or Nullable(Of Decimal) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Double>
This method returns zero if contains no elements.
The result does not include values that are null.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Double> in C# or Nullable(Of Double) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int32>
This method returns zero if contains no elements.
The result does not include values that are null.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Int32> in C# or Nullable(Of Int32) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Int64>
This method returns zero if contains no elements.
The result does not include values that are null.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Int64> in C# or Nullable(Of Int64) in vbprvb
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Nullable<System.Single>
This method returns zero if contains no elements.
The result does not include values that are null.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically Nullable<Single> in C# or Nullable(Of Single) in vbprvb.
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Single
The method returns zero if contains no elements.
You can apply this method to a sequence of arbitrary values if you provide a function, , that projects the members of into a numeric type, specifically .
In vbprvb query expression syntax, an Aggregate Into Sum() clause translates to an invocation of .
Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence.
The sum of the projected values.
A sequence of values that are used to calculate a sum.
A transform function to apply to each element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
enumerates and yields elements until elements have been yielded or contains no more elements. If exceeds the number of elements in , all elements of are returned.
If is less than or equal to zero, is not enumerated and an empty is returned.
The and methods are functional complements. Given a sequence coll and an integer n, concatenating the results of coll.Take(n) and coll.Skip(n) yields the same sequence as coll.
In vbprvb query expression syntax, a Take clause translates to an invocation of .
Returns a specified number of contiguous elements from the start of a sequence.
An that contains the specified number of elements from the start of the input sequence.
The sequence to return elements from.
The number of elements to return.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method tests each element of by using and yields the element if the result is true. Enumeration stops when the predicate function returns false for an element or when contains no more elements.
The and methods are functional complements. Given a sequence coll and a pure function p, concatenating the results of coll.TakeWhile(p) and coll.SkipWhile(p) yields the same sequence as coll.
In vbprvb query expression syntax, a Take While clause translates to an invocation of .
Returns elements from a sequence as long as a specified condition is true.
An that contains the elements from the input sequence that occur before the element at which the test no longer passes.
A sequence to return elements from.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method tests each element of by using and yields the element if the result is true. Enumeration stops when the predicate function returns false for an element or when contains no more elements.
The first argument of represents the element to test. The second argument represents the zero-based index of the element within .
The and methods are functional complements. Given a sequence coll and a pure function p, concatenating the results of coll.TakeWhile(p) and coll.SkipWhile(p) yields the same sequence as coll.
In vbprvb query expression syntax, a Take While clause translates to an invocation of .
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.
An that contains elements from the input sequence that occur before the element at which the test no longer passes.
The sequence to return elements from.
A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Linq.IOrderedEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
To order a sequence by the values of the elements themselves, specify the identity function (x => x in csprcs or Function(x) x in vbprvb) for .
and are defined to extend the type , which is also the return type of these methods. This design enables you to specify multiple sort criteria by applying any number of or methods.
Because inherits from , you can call or on the results of a call to , , or . Doing this introduces a new primary ordering that ignores the previously established ordering.
This method compares keys by using the default comparer .
This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key.
In query expression syntax, an orderby [first criterion], [second criterion] (csprcs) or Order By [first criterion], [second criterion] (vbprvb) clause translates to an invocation of .
Performs a subsequent ordering of the elements in a sequence in ascending order according to a key.
An whose elements are sorted according to a key.
An that contains elements to sort.
A function to extract a key from each element.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Linq.IOrderedEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
To order a sequence by the values of the elements themselves, specify the identity function (x => x in csprcs or Function(x) x in vbprvb) for .
and are defined to extend the type , which is also the return type of these methods. This design enables you to specify multiple sort criteria by applying any number of or methods.
Because inherits from , you can call or on the results of a call to , , or . Doing this introduces a new primary ordering that ignores the previously established ordering.
If is null, the default comparer is used to compare keys.
This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key.
Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer.
An whose elements are sorted according to a key.
An that contains elements to sort.
A function to extract a key from each element.
An to compare keys.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Linq.IOrderedEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
To order a sequence by the values of the elements themselves, specify the identity function (x => x in csprcs or Function(x) x in vbprvb) for .
and are defined to extend the type , which is also the return type of these methods. This design enables you to specify multiple sort criteria by applying any number of or methods.
Because inherits from , you can call or on the results of a call to , , or . Doing this introduces a new primary ordering that ignores the previously established ordering.
This sorting method compares keys by using the default comparer .
This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key.
In csprcs query expression syntax, an orderby [first criterion], [second criterion] descending clause translates to an invocation of .
In vbprvb query expression syntax, an Order By [first criterion], [second criterion] Descending clause translates to an invocation of .
Performs a subsequent ordering of the elements in a sequence in descending order, according to a key.
An whose elements are sorted in descending order according to a key.
An that contains elements to sort.
A function to extract a key from each element.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Linq.IOrderedEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
To order a sequence by the values of the elements themselves, specify the identity function (x => x in csprcs or Function(x) x in vbprvb) for .
and are defined to extend the type , which is also the return type of these methods. This design enables you to specify multiple sort criteria by applying any number of or methods.
Because inherits from , you can call or on the results of a call to , , or . Doing this introduces a new primary ordering that ignores the previously established ordering.
If is null, the default comparer is used to compare keys.
This method performs a stable sort; that is, if the keys of two elements are equal, the order of the elements is preserved. In contrast, an unstable sort does not preserve the order of elements that have the same key.
Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer.
An whose elements are sorted in descending order according to a key.
An that contains elements to sort.
A function to extract a key from each element.
An to compare keys.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
TSource[]
The method forces immediate query evaluation and returns an array that contains the query results. You can append this method to your query in order to obtain a cached copy of the query results.
has similar behavior but returns a instead of an array.
Creates an array from a .
An array that contains the elements from the input sequence.
An to create an array from.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.Dictionary<TKey,TSource>
The method uses the default equality comparer to compare keys.
Creates a from an according to a specified key selector function.
A that contains keys and values.
An to create a from.
A function to extract a key from each element.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.Dictionary<TKey,TSource>
If is null, the default equality comparer is used to compare keys.
Creates a from an according to a specified key selector function and key comparer.
A that contains keys and values.
An to create a from.
A function to extract a key from each element.
An to compare keys.
The type of the elements of .
The type of the keys returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.Dictionary<TKey,TElement>
The method uses the default equality comparer to compare keys.
Creates a from an according to specified key selector and element selector functions.
A that contains values of type selected from the input sequence.
An to create a from.
A function to extract a key from each element.
A transform function to produce a result element value from each element.
The type of the elements of .
The type of the key returned by .
The type of the value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.Dictionary<TKey,TElement>
If is null, the default equality comparer is used to compare keys.
Creates a from an according to a specified key selector function, a comparer, and an element selector function.
A that contains values of type selected from the input sequence.
An to create a from.
A function to extract a key from each element.
A transform function to produce a result element value from each element.
An to compare keys.
The type of the elements of .
The type of the key returned by .
The type of the value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.List<TSource>
The method forces immediate query evaluation and returns a that contains the query results. You can append this method to your query in order to obtain a cached copy of the query results.
has similar behavior but returns an array instead of a .
Creates a from an .
A that contains elements from the input sequence.
The to create a from.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Linq.ILookup<TKey,TSource>
The method returns a , a one-to-many dictionary that maps keys to collections of values. A differs from a , which performs a one-to-one mapping of keys to single values.
The default equality comparer is used to compare keys.
Creates a from an according to a specified key selector function.
A that contains keys and values.
The to create a from.
A function to extract a key from each element.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Linq.ILookup<TKey,TSource>
The method returns a , a one-to-many dictionary that maps keys to collections of values. A is different to a , which performs a one-to-one mapping of keys to single values.
If is null, the default equality comparer is used to compare keys.
Creates a from an according to a specified key selector function and key comparer.
A that contains keys and values.
The to create a from.
A function to extract a key from each element.
An to compare keys.
The type of the elements of .
The type of the key returned by .
Method
3.5.0.0
4.0.0.0
System.Linq.ILookup<TKey,TElement>
The method returns a , a one-to-many dictionary that maps keys to collections of values. A differs from a , which performs a one-to-one mapping of keys to single values.
The default equality comparer is used to compare keys.
Creates a from an according to specified key selector and element selector functions.
A that contains values of type selected from the input sequence.
The to create a from.
A function to extract a key from each element.
A transform function to produce a result element value from each element.
The type of the elements of .
The type of the key returned by .
The type of the value returned by .
Method
3.5.0.0
4.0.0.0
System.Linq.ILookup<TKey,TElement>
The method returns a , a one-to-many dictionary that maps keys to collections of values. A differs from a , which performs a one-to-one mapping of keys to single values.
If is null, the default equality comparer is used to compare keys.
Creates a from an according to a specified key selector function, a comparer and an element selector function.
A that contains values of type selected from the input sequence.
The to create a from.
A function to extract a key from each element.
A transform function to produce a result element value from each element.
An to compare keys.
The type of the elements of .
The type of the key returned by .
The type of the value returned by .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
This method excludes duplicates from the return set. This is different behavior to the method, which returns all the elements in the input sequences including duplicates.
The default equality comparer, , is used to compare values of the types that implement the generic interface. To compare a custom data type, you need to implement this interface and provide your own and methods for the type.
When the object returned by this method is enumerated, enumerates and in that order and yields each element that has not already been yielded.
Produces the set union of two sequences by using the default equality comparer.
An that contains the elements from both input sequences, excluding duplicates.
An whose distinct elements form the first set for the union.
An whose distinct elements form the second set for the union.
The type of the elements of the input sequences.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
If c is null, the default equality comparer, , is used to compare values.
When the object returned by this method is enumerated, enumerates and in that order and yields each element that has not already been yielded.
The method differs from the method because the method returns all the elements in the input sequences including duplicates, whereas returns only unique values.
Produces the set union of two sequences by using a specified .
An that contains the elements from both input sequences, excluding duplicates.
An whose distinct elements form the first set for the union.
An whose distinct elements form the second set for the union.
The to compare values.
The type of the elements of the input sequences.
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
In query expression syntax, a where (csprcs) or Where (vbprvb) clause translates to an invocation of .
Filters a sequence of values based on a predicate.
An that contains elements from the input sequence that satisfy the condition.
An to filter.
A function to test each element for a condition.
The type of the elements of .
Method
3.5.0.0
4.0.0.0
System.Collections.Generic.IEnumerable<TSource>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The first argument of represents the element to test. The second argument represents the zero-based index of the element within .
Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function.
An that contains elements from the input sequence that satisfy the condition.
An to filter.
A function to test each source element for a condition; the second parameter of the function represents the index of the source element.
The type of the elements of .
Method
4.0.0.0
System.Collections.Generic.IEnumerable<TResult>
This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in csprcs or For Each in vbprvb.
The method merges each element of the first sequence with an element that has the same index in the second sequence. If the sequences do not have the same number of elements, the method merges sequences until it reaches the end of one of them. For example, if one sequence has three elements and the other one has four, the result sequence will have only three elements.
Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.
An that contains merged elements of two input sequences.
The first sequence to merge.
The second sequence to merge.
A function that specifies how to merge the elements from the two sequences.
The type of the elements of the first input sequence.
The type of the elements of the second input sequence.
The type of the elements of the result sequence.