AsyncEnumerable.MaxByAsync Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Overloads
| Name | Description |
|---|---|
| MaxByAsync<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>, CancellationToken) |
Retourneert de maximumwaarde in een algemene reeks volgens een opgegeven sleutelkiezerfunctie. |
| MaxByAsync<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, IComparer<TKey>, CancellationToken) |
Retourneert de maximumwaarde in een algemene reeks volgens een opgegeven sleutelkiezerfunctie. |
MaxByAsync<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>, CancellationToken)
- Bron:
- MaxByAsync.cs
- Bron:
- MaxByAsync.cs
- Bron:
- MaxByAsync.cs
Retourneert de maximumwaarde in een algemene reeks volgens een opgegeven sleutelkiezerfunctie.
public static System.Threading.Tasks.ValueTask<TSource?> MaxByAsync<TSource,TKey>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IComparer<TKey>? comparer = default, System.Threading.CancellationToken cancellationToken = default);
static member MaxByAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, 'Key> * System.Collections.Generic.IComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Source>
<Extension()>
Public Function MaxByAsync(Of TSource, TKey) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, TKey), Optional comparer As IComparer(Of TKey) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TSource)
Type parameters
- TSource
Het type van de elementen van source.
- TKey
Het type sleutel om elementen te vergelijken.
Parameters
- source
- IAsyncEnumerable<TSource>
Een reeks waarden om de maximumwaarde van te bepalen.
- keySelector
- Func<TSource,TKey>
Een functie om de sleutel voor elk element te extraheren.
- comparer
- IComparer<TKey>
De IComparer<T> om sleutels te vergelijken.
- cancellationToken
- CancellationToken
De CancellationToken te controleren op annuleringsaanvragen. De standaardwaarde is None.
Retouren
De waarde met de maximumsleutel in de reeks.
Uitzonderingen
source is null.
Er is geen sleutel geëxtraheerd uit source de IComparable implementatie of IComparable<T> interface.
Opmerkingen
Als TKey dit een verwijzingstype is en de bronreeks leeg is of alleen waarden bevat, nullretourneert nulldeze methode .
Van toepassing op
MaxByAsync<TSource,TKey>(IAsyncEnumerable<TSource>, Func<TSource,CancellationToken,ValueTask<TKey>>, IComparer<TKey>, CancellationToken)
- Bron:
- MaxByAsync.cs
- Bron:
- MaxByAsync.cs
- Bron:
- MaxByAsync.cs
Retourneert de maximumwaarde in een algemene reeks volgens een opgegeven sleutelkiezerfunctie.
public static System.Threading.Tasks.ValueTask<TSource?> MaxByAsync<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, System.Threading.CancellationToken cancellationToken = default);
static member MaxByAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * Func<'Source, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<'Key>> * System.Collections.Generic.IComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Source>
<Extension()>
Public Function MaxByAsync(Of TSource, TKey) (source As IAsyncEnumerable(Of TSource), keySelector As Func(Of TSource, CancellationToken, ValueTask(Of TKey)), Optional comparer As IComparer(Of TKey) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TSource)
Type parameters
- TSource
Het type van de elementen van source.
- TKey
Het type sleutel om elementen te vergelijken.
Parameters
- source
- IAsyncEnumerable<TSource>
Een reeks waarden om de maximumwaarde van te bepalen.
- keySelector
- Func<TSource,CancellationToken,ValueTask<TKey>>
Een functie om de sleutel voor elk element te extraheren.
- comparer
- IComparer<TKey>
De IComparer<T> om sleutels te vergelijken.
- cancellationToken
- CancellationToken
De CancellationToken te controleren op annuleringsaanvragen. De standaardwaarde is None.
Retouren
De waarde met de maximumsleutel in de reeks.
Uitzonderingen
source is null.
Er is geen sleutel geëxtraheerd uit source de IComparable implementatie of IComparable<T> interface.
Opmerkingen
Als TKey dit een verwijzingstype is en de bronreeks leeg is of alleen waarden bevat, nullretourneert nulldeze methode .