AsyncEnumerable.OrderBy 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
OrderBy<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, IComparer<TKey>)
- Source:
- OrderBy.cs
- Source:
- OrderBy.cs
- Source:
- OrderBy.cs
按升序对序列的元素进行排序。
public static System.Linq.IOrderedAsyncEnumerable<TSource> OrderBy<TSource,TKey>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<TKey>> keySelector, System.Collections.Generic.IComparer<TKey>? comparer = default);
static member OrderBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Key>> * System.Collections.Generic.IComparer<'Key> -> System.Linq.IOrderedAsyncEnumerable<'Source>
<Extension()>
Public Function OrderBy(Of TSource, TKey) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, CancellationToken, ValueTask(Of TKey)), Optional comparer As IComparer(Of TKey) = Nothing) As IOrderedAsyncEnumerable(Of TSource)
类型参数
- TSource
的元素 source的类型。
- TKey
返回 keySelector的键的类型。
参数
- source
- IAsyncEnumerable<TSource>
要排序的值序列。
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
用于从元素中提取键的函数。
- comparer
- IComparer<TKey>
要比较键的一个 IComparer<T> 。
返回
IOrderedAsyncEnumerable<TSource>
IAsyncEnumerable<T>其元素根据键进行排序。
例外
keySelector 是 null。
适用于
OrderBy<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)
- Source:
- OrderBy.cs
- Source:
- OrderBy.cs
- Source:
- OrderBy.cs
按升序对序列的元素进行排序。
public static System.Linq.IOrderedAsyncEnumerable<TSource> OrderBy<TSource,TKey>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IComparer<TKey>? comparer = default);
static member OrderBy : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * System.Collections.Generic.IComparer<'Key> -> System.Linq.IOrderedAsyncEnumerable<'Source>
<Extension()>
Public Function OrderBy(Of TSource, TKey) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), Optional comparer As IComparer(Of TKey) = Nothing) As IOrderedAsyncEnumerable(Of TSource)
类型参数
- TSource
的元素 source的类型。
- TKey
返回 keySelector的键的类型。
参数
- source
- IAsyncEnumerable<TSource>
要排序的值序列。
- keySelector
- Func<TSource,TKey>
用于从元素中提取键的函数。
- comparer
- IComparer<TKey>
要比较键的一个 IComparer<T> 。
返回
IOrderedAsyncEnumerable<TSource>
IAsyncEnumerable<T>其元素根据键进行排序。
例外
keySelector 是 null。