,System.Action{--0})} ,System.Action{--0},System.Action)} ,System.Action{--0},System.Action{System.Exception})} ,System.Action{--0},System.Action{System.Exception},System.Action)} ,System.IObserver{--0})}
Observable.Do(IObservable, Action) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext) - 2.
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext, Action onCompleted) - 3.
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext, Action<Exception> onError) - 4.
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext, Action<Exception> onError, Action onCompleted) - 5.
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, IObserver<TSource> observer)
1. Overload¶
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext)
Summary: Invokes an action for each element in the observable sequence, and propagates all observer messages through the result sequence. This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
onNext | Action | Action to invoke for each element in the observable sequence. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext is null. |
2. Overload¶
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext, Action onCompleted)
Summary: Invokes an action for each element in the observable sequence and invokes an action upon graceful termination of the observable sequence. This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
onNext | Action | Action to invoke for each element in the observable sequence. |
onCompleted | Action | Action to invoke upon graceful termination of the observable sequence. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext or onCompleted is null. |
3. Overload¶
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext, Action<Exception> onError)
Summary: Invokes an action for each element in the observable sequence and invokes an action upon exceptional termination of the observable sequence. This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
onNext | Action | Action to invoke for each element in the observable sequence. |
onError | Action | Action to invoke upon exceptional termination of the observable sequence. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext or onError is null. |
4. Overload¶
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, Action<TSource> onNext, Action<Exception> onError, Action onCompleted)
Summary: Invokes an action for each element in the observable sequence and invokes an action upon graceful or exceptional termination of the observable sequence. This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
onNext | Action | Action to invoke for each element in the observable sequence. |
onError | Action | Action to invoke upon exceptional termination of the observable sequence. |
onCompleted | Action | Action to invoke upon graceful termination of the observable sequence. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext or onError or onCompleted is null. |
5. Overload¶
public static IObservable<TSource> Do<TSource>(this IObservable<TSource> source, IObserver<TSource> observer)
Summary: Invokes the observer's methods for each message in the source sequence. This method can be used for debugging, logging, etc. of query behavior by intercepting the message stream to run arbitrary actions for messages on the pipeline.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | Source sequence. |
observer | IObserver | Observer whose methods to invoke as part of the source sequence's observation. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or observer is null. |