,--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)
Summary: Asynchronously determines whether the sequence contains a specified value using the given equality comparer.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
value | T | The value to locate in the sequence. |
comparer | IEqualityComparer | The equality comparer to use for comparing values, or null to use the default equality comparer for the type. |
Returns: ValueTasktrue 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
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
value | T | The value to locate in the sequence. |
comparer | IEqualityComparer | The equality comparer to use for comparing values, or null to use the default equality comparer for the type. |
cancellationToken | CancellationToken | A cancellation token that can be used to cancel the asynchronous operation. |
Returns: ValueTasktrue if the
value is found in the sequence; otherwise, false.
3. Overload¶
public static ValueTask<bool> ContainsAsync<T>(this IObservableAsync<T> @this, T value)
Summary: Asynchronously determines whether the collection contains a specified value.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
value | T | The value to locate in the collection. |
Returns: ValueTasktrue 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)
Summary: Asynchronously determines whether the collection contains a specified value.
Type parameters
| Name | Description |
|---|---|
T | The type of elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
this | [IObservableAsync | The source observable sequence. |
value | T | The value to locate in the collection. |
cancellationToken | CancellationToken | A cancellation token that can be used to cancel the asynchronous operation. |
Returns: ValueTasktrue if the
value is found in the collection; otherwise, false.