Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


AsyncEnumerable.OrderByDescending Method

Definition

Overloads

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

Source:
OrderBy.cs

Sorts the elements of a sequence in descending order.

C#
public static System.Linq.IOrderedAsyncEnumerable<TSource> OrderByDescending<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);

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

Parameters

source
IAsyncEnumerable<TSource>

A sequence of values to order.

keySelector
Func<TSource,CancellationToken,ValueTask<TKey>>

A function to extract a key from an element.

comparer
IComparer<TKey>

An IComparer<T> to compare keys.

Returns

An IAsyncEnumerable<T> whose elements are sorted in descending order according to a key.

Exceptions

keySelector is null.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided), 10
.NET Standard 2.0 (package-provided)

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

Source:
OrderBy.cs

Sorts the elements of a sequence in descending order.

C#
public static System.Linq.IOrderedAsyncEnumerable<TSource> OrderByDescending<TSource,TKey>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IComparer<TKey>? comparer = default);

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector.

Parameters

source
IAsyncEnumerable<TSource>

A sequence of values to order.

keySelector
Func<TSource,TKey>

A function to extract a key from an element.

comparer
IComparer<TKey>

An IComparer<T> to compare keys.

Returns

An IAsyncEnumerable<T> whose elements are sorted in descending order according to a key.

Exceptions

keySelector is null.

Applies to

.NET 10 és más verziók
Termék Verziók
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided), 10
.NET Standard 2.0 (package-provided)