語言

AsyncEnumerable.OrderBy 方法

定義

多載

OrderBy<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, IComparer<TKey>)

來源:
OrderBy.cs
來源:
OrderBy.cs
來源:
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> 比較鑰匙。

傳回

一個 IAsyncEnumerable<T> 元素依照鍵排序的符號。

例外狀況

keySelector 是 null。

適用於

OrderBy<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

來源:
OrderBy.cs
來源:
OrderBy.cs
來源:
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> 比較鑰匙。

傳回

一個 IAsyncEnumerable<T> 元素依照鍵排序的符號。

例外狀況

keySelector 是 null。

適用於