AsyncEnumerable.ContainsAsync<TSource> Methode

Definitie

Bepaalt of een reeks een opgegeven element bevat.

public static System.Threading.Tasks.ValueTask<bool> ContainsAsync<TSource>(this System.Collections.Generic.IAsyncEnumerable<TSource> source, TSource value, System.Collections.Generic.IEqualityComparer<TSource>? comparer = default, System.Threading.CancellationToken cancellationToken = default);
static member ContainsAsync : System.Collections.Generic.IAsyncEnumerable<'Source> * 'Source * System.Collections.Generic.IEqualityComparer<'Source> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<bool>
<Extension()>
Public Function ContainsAsync(Of TSource) (source As IAsyncEnumerable(Of TSource), value As TSource, Optional comparer As IEqualityComparer(Of TSource) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of Boolean)

Type parameters

TSource

Het type van de elementen van de bron.

Parameters

source
IAsyncEnumerable<TSource>

Een reeks waarin een waarde moet worden gevonden.

value
TSource

De waarde die in de reeks moet worden gevonden.

comparer
IEqualityComparer<TSource>

Een gelijkheidsgelijker om waarden te vergelijken.

cancellationToken
CancellationToken

De CancellationToken te controleren op annuleringsaanvragen. De standaardwaarde is None.

Retouren

true als de bronreeks een element bevat dat de opgegeven waarde heeft; anders, false.

Uitzonderingen

source is null.

Van toepassing op