Enumerable.Zip
将指定函数应用于两个序列的对应元素,以生成结果序列。
Element Operations
Method Name |
Description |
More Information |
ElementAt |
Returns the element at a specified index in a collection. |
|
ElementAtOrDefault |
Returns the element at a specified index in a collection or a default value if the index is out of range. |
|
First |
Returns the first element of a collection, or the first element that satisfies a condition. |
|
FirstOrDefault |
Returns the first element of a collection, or the first element that satisfies a condition. Returns a default value if no such element exists. |
Enumerable.FirstOrDefault Queryable.FirstOrDefault Queryable.FirstOrDefault<TSour |
Last |
Returns the last element of a collection, or the last element that satisfies a condition. |
|
LastOrDefault |
Returns the last element of a collection, or the last element that satisfies a condition. Returns a default value if no such element exists. |
|
Single |
Returns the only element of a collection or the only element that satisfies a condition. Throws an InvalidOperationExceptionif there is no element or more than one element to return. |
|
SingleOrDefault |
Returns the only element of a collection or the only element that satisfies a condition. Returns a default value if there is no element to return. Throws an InvalidOperationException if there is more than one element to return. |
Converting Data Types
Method Name |
Description |
More Information |
AsEnumerable |
Returns the input typed as IEnumerable<T>. |
AsQueryable |
Converts a (generic) IEnumerable to a (generic) IQueryable. |
|
Cast |
Casts the elements of a collection to a specified type. |
|
OfType |
Filters values, depending on their ability to be cast to a specified type. |
|
ToArray |
Converts a collection to an array. This method forces query execution. |
|
ToDictionary |
Puts elements into a Dictionary<TKey,TValue> based on a key selector function. This method forces query execution. |
|
ToList |
Converts a collection to a List<T>. This method forces query execution. |
|
ToLookup |
Puts elements into a Lookup<TKey,TElement> (a one-to- many dictionary) based on a key selector function. This method forces query execution. |
------------恢复内容开始------------
Enumerable.Zip
将指定函数应用于两个序列的对应元素,以生成结果序列。
Element Operations
Method Name |
Description |
More Information |
ElementAt |
Returns the element at a specified index in a collection. |
|
ElementAtOrDefault |
Returns the element at a specified index in a collection or a default value if the index is out of range. |
|
First |
Returns the first element of a collection, or the first element that satisfies a condition. |
|
FirstOrDefault |
Returns the first element of a collection, or the first element that satisfies a condition. Returns a default value if no such element exists. |
Enumerable.FirstOrDefault Queryable.FirstOrDefault Queryable.FirstOrDefault<TSour |
Last |
Returns the last element of a collection, or the last element that satisfies a condition. |
|
LastOrDefault |
Returns the last element of a collection, or the last element that satisfies a condition. Returns a default value if no such element exists. |
|
Single |
Returns the only element of a collection or the only element that satisfies a condition. Throws an InvalidOperationExceptionif there is no element or more than one element to return. |
|
SingleOrDefault |
Returns the only element of a collection or the only element that satisfies a condition. Returns a default value if there is no element to return. Throws an InvalidOperationException if there is more than one element to return. |
Converting Data Types
Method Name |
Description |
More Information |
AsEnumerable |
Returns the input typed as IEnumerable<T>. |
AsQueryable |
Converts a (generic) IEnumerable to a (generic) IQueryable. |
|
Cast |
Casts the elements of a collection to a specified type. |
|
OfType |
Filters values, depending on their ability to be cast to a specified type. |
|
ToArray |
Converts a collection to an array. This method forces query execution. |
|
ToDictionary |
Puts elements into a Dictionary<TKey,TValue> based on a key selector function. This method forces query execution. |
|
ToList |
Converts a collection to a List<T>. This method forces query execution. |
|
ToLookup |
Puts elements into a Lookup<TKey,TElement> (a one-to- many dictionary) based on a key selector function. This method forces query execution. |
Aggregation Operations
Method Name |
Description |
More Information |
Aggregate |
Performs a custom aggregation operation on the values of a collection. |
|
Average |
Calculates the average value of a collection of values. |
|
Count |
Counts the elements in a collection, optionally only those elements that satisfy a predicate function. |
|
LongCount |
Counts the elements in a large collection, optionally only those elements that satisfy a predicate function. |
|
Max |
Determines the maximum value in a collection. |
|
Min |
Determines the minimum value in a collection. |
|
Sum |
Calculates the sum of the values in a collection. |