Skip to content

)} ,System.Func{--0,System.Boolean})}

Observable.Any(IObservable) method

Defined in

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

Applies to

netstandard2.0

Overloads

  • 1. public static IObservable<bool> Any<TSource>(this IObservable<TSource> source)
  • 2. public static IObservable<bool> Any<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)

1. Overload

public static IObservable<bool> Any<TSource>(this IObservable<TSource> source)

Summary: Determines whether an observable sequence contains any elements.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableAn observable sequence to check for non-emptiness.

Returns: IObservable -- An observable sequence containing a single element determining whether the source sequence contains any elements.

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 IObservable<bool> Any<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)

Summary: Determines whether any element of an observable sequence satisfies a condition.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.

Parameters

NameTypeDescription
sourceIObservableAn observable sequence whose elements to apply the predicate to.
predicateFuncA function to test each element for a condition.

Returns: IObservable -- An observable sequence containing a single element determining whether any elements in the source sequence pass the test in the specified predicate.

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 predicate is null.