Skip to content

,--0,System.Collections.Generic.IEqualityComparer{--0})} ,--0,System.Collections.Generic.IEqualityComparer{--0},System.Threading.CancellationToken)} ,--0)} ,--0,System.Threading.CancellationToken)}

ObservableAsync.ContainsAsync(IObservableAsync, T, IEqualityComparer?) method

Defined in

Type: ObservableAsync Namespace: ReactiveUI.Extensions.Async Assembly: ReactiveUI.Extensions.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Overloads

  • 1. public static ValueTask<bool> ContainsAsync<T>(this IObservableAsync<T> @this, T value, IEqualityComparer<T>? comparer)
  • 2. public static ValueTask<bool> ContainsAsync<T>(this IObservableAsync<T> @this, T value, IEqualityComparer<T>? comparer, CancellationToken cancellationToken)
  • 3. public static ValueTask<bool> ContainsAsync<T>(this IObservableAsync<T> @this, T value)
  • 4. public static ValueTask<bool> ContainsAsync<T>(this IObservableAsync<T> @this, T value, CancellationToken cancellationToken)

1. Overload

public static ValueTask<bool> ContainsAsync<T>(this IObservableAsync<T> @this, T value, IEqualityComparer<T>? comparer)

View source

Summary: Asynchronously determines whether the sequence contains a specified value using the given equality comparer.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
valueTThe value to locate in the sequence.
comparerIEqualityComparer?The equality comparer to use for comparing values, or null to use the default equality comparer for the type.

Returns: ValueTask -- A task that represents the asynchronous operation. The task result contains true if the value is found in the sequence; otherwise, false.

2. Overload

public static ValueTask<bool> ContainsAsync<T>(this IObservableAsync<T> @this, T value, IEqualityComparer<T>? comparer, CancellationToken cancellationToken)

Summary: Asynchronously determines whether the sequence contains a specified value using the given equality comparer.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
valueTThe value to locate in the sequence.
comparerIEqualityComparer?The equality comparer to use for comparing values, or null to use the default equality comparer for the type.
cancellationTokenCancellationTokenA cancellation token that can be used to cancel the asynchronous operation.

Returns: ValueTask -- A task that represents the asynchronous operation. The task result contains true if the value is found in the sequence; otherwise, false.

3. Overload

public static ValueTask<bool> ContainsAsync<T>(this IObservableAsync<T> @this, T value)

View source

Summary: Asynchronously determines whether the collection contains a specified value.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
valueTThe value to locate in the collection.

Returns: ValueTask -- A task that represents the asynchronous operation. The task result contains true if the value is found in the collection; otherwise, false.

4. Overload

public static ValueTask<bool> ContainsAsync<T>(this IObservableAsync<T> @this, T value, CancellationToken cancellationToken)

View source

Summary: Asynchronously determines whether the collection contains a specified value.

Type parameters

NameDescription
TThe type of elements in the source sequence.

Parameters

NameTypeDescription
this[IObservableAsync](#The source observable sequence.
valueTThe value to locate in the collection.
cancellationTokenCancellationTokenA cancellation token that can be used to cancel the asynchronous operation.

Returns: ValueTask -- A task that represents the asynchronous operation. The task result contains true if the value is found in the collection; otherwise, false.