,System.Func{--0,System.Boolean})} ,System.Func{--0,System.Int32,System.Boolean})}
Observable.Where(IObservable, Func) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObservable<TSource> Where<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate) - 2.
public static IObservable<TSource> Where<TSource>(this IObservable<TSource> source, Func<TSource, int, bool> predicate)
1. Overload¶
public static IObservable<TSource> Where<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
Summary: Filters the elements of an observable sequence based on a predicate.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to filter. |
predicate | Func | A function to test each source element for a condition. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or predicate is null. |
2. Overload¶
public static IObservable<TSource> Where<TSource>(this IObservable<TSource> source, Func<TSource, int, bool> predicate)
Summary: Filters the elements of an observable sequence based on a predicate by incorporating the element's index.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to filter. |
predicate | Func | A function to test each source element for a condition; the second parameter of the function represents the index of the source element. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or predicate is null. |