Summary
Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
Syntax
public static IObservable<TResult> ConcatMap<TSource, TTaskResult, TResult>(this IObservable<TSource> source, Func<TSource, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector)
Type Parameters
Name |
Description |
TSource |
The type of the elements in the source sequence. |
TTaskResult |
The type of the results produced by the projected intermediate tasks. |
TResult |
The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate task results. |
Parameters
Name |
Type |
Description |
source |
IObservable<TSource> |
An observable sequence of elements to project. |
taskSelector |
Func<TSource, Task<TTaskResult>> |
A transform function to apply to each element. |
resultSelector |
Func<TSource, TTaskResult, TResult> |
A transform function to apply to each element of the intermediate sequence. |
Return Value
Type |
Description |
IObservable<TResult> |
An observable sequence whose elements are the result of obtaining a task for each element of the input sequence and then mapping the task's result and its corresponding source element to a result element. |