Skip to content

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

Qbservable.Contains(IQbservable, TSource) method

Defined in

Type: Qbservable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IQbservable<bool> Contains<TSource>(this IQbservable<TSource> source, TSource value)
  • 2. public static IQbservable<bool> Contains<TSource>(this IQbservable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)

1. Overload

public static IQbservable<bool> Contains<TSource>(this IQbservable<TSource> source, TSource value)

Summary: Determines whether an observable sequence contains a specified element by using the default equality comparer.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#An observable sequence in which to locate a value.
valueTSourceThe value to locate in the source sequence.

Returns: IQbservable -- An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource is null.

2. Overload

public static IQbservable<bool> Contains<TSource>(this IQbservable<TSource> source, TSource value, IEqualityComparer<TSource> comparer)

Summary: Determines whether an observable sequence contains a specified element by using a specified System.Collections.Generic.IEqualityComparer.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#An observable sequence in which to locate a value.
valueTSourceThe value to locate in the source sequence.
comparerIEqualityComparerAn equality comparer to compare elements.

Returns: IQbservable -- An observable sequence containing a single element determining whether the source sequence contains an element that has the specified value.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or comparer is null.