,System.Linq.Expressions.Expression{System.Func{--0,System.IObservable{--1}}},System.Linq.Expressions.Expression{System.Func{--0,--1,--2}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32,System.IObservable{--1}}},System.Linq.Expressions.Expression{System.Func{--0,System.Int32,--1,System.Int32,--2}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Collections.Generic.IEnumerable{--1}}},System.Linq.Expressions.Expression{System.Func{--0,--1,--2}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32,System.Collections.Generic.IEnumerable{--1}}},System.Linq.Expressions.Expression{System.Func{--0,System.Int32,--1,System.Int32,--2}})} ,System.IObservable{--1})} ,System.Linq.Expressions.Expression{System.Func{--0,System.IObservable{--1}}},System.Linq.Expressions.Expression{System.Func{System.Exception,System.IObservable{--1}}},System.Linq.Expressions.Expression{System.Func{System.IObservable{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32,System.IObservable{--1}}},System.Linq.Expressions.Expression{System.Func{System.Exception,System.IObservable{--1}}},System.Linq.Expressions.Expression{System.Func{System.IObservable{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.IObservable{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32,System.IObservable{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Threading.Tasks.Task{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32,System.Threading.Tasks.Task{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Threading.CancellationToken,System.Threading.Tasks.Task{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32,System.Threading.CancellationToken,System.Threading.Tasks.Task{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Collections.Generic.IEnumerable{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32,System.Collections.Generic.IEnumerable{--1}}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Threading.Tasks.Task{--1}}},System.Linq.Expressions.Expression{System.Func{--0,--1,--2}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32,System.Threading.Tasks.Task{--1}}},System.Linq.Expressions.Expression{System.Func{--0,System.Int32,--1,--2}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Threading.CancellationToken,System.Threading.Tasks.Task{--1}}},System.Linq.Expressions.Expression{System.Func{--0,--1,--2}})} ,System.Linq.Expressions.Expression{System.Func{--0,System.Int32,System.Threading.CancellationToken,System.Threading.Tasks.Task{--1}}},System.Linq.Expressions.Expression{System.Func{--0,System.Int32,--1,--2}})}
Qbservable.SelectMany(IQbservable, Expression>>, Expression>) method¶
Defined in
Type: Qbservable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IQbservable<TResult> SelectMany<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector) - 2.
public static IQbservable<TResult> SelectMany<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TCollection>>> collectionSelector, Expression<Func<TSource, int, TCollection, int, TResult>> resultSelector) - 3.
public static IQbservable<TResult> SelectMany<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector) - 4.
public static IQbservable<TResult> SelectMany<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, int, TCollection, int, TResult>> resultSelector) - 5.
public static IQbservable<TOther> SelectMany<TSource, TOther>(this IQbservable<TSource> source, IObservable<TOther> other) - 6.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TResult>>> onNext, Expression<Func<Exception, IObservable<TResult>>> onError, Expression<Func<IObservable<TResult>>> onCompleted) - 7.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TResult>>> onNext, Expression<Func<Exception, IObservable<TResult>>> onError, Expression<Func<IObservable<TResult>>> onCompleted) - 8.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TResult>>> selector) - 9.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TResult>>> selector) - 10.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, Task<TResult>>> selector) - 11.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, Task<TResult>>> selector) - 12.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, CancellationToken, Task<TResult>>> selector) - 13.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, CancellationToken, Task<TResult>>> selector) - 14.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector) - 15.
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IEnumerable<TResult>>> selector) - 16.
public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, TTaskResult, TResult>> resultSelector) - 17.
public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, int, TTaskResult, TResult>> resultSelector) - 18.
public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, CancellationToken, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, TTaskResult, TResult>> resultSelector) - 19.
public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, CancellationToken, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, int, TTaskResult, TResult>> resultSelector)
1. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
Summary: Projects each element of an observable sequence to an enumerable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TCollection | The type of the elements in the projected intermediate enumerable sequences. |
TResult | The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
collectionSelector | Expression | A transform function to apply to each element. |
resultSelector | Expression | A transform function to apply to each element of the intermediate sequence. |
Returns: IQbservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or collectionSelector or resultSelector is null. |
2. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TCollection>>> collectionSelector, Expression<Func<TSource, int, TCollection, int, TResult>> resultSelector)
Summary: Projects each element of an observable sequence to an enumerable sequence by incorporating the element's index, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TCollection | The type of the elements in the projected intermediate enumerable sequences. |
TResult | The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
collectionSelector | Expression | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
resultSelector | Expression | A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element and the fourth parameter represents the index of the intermediate element. |
Returns: IQbservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or collectionSelector or resultSelector is null. |
3. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, TCollection, TResult>> resultSelector)
Summary: Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TCollection | The type of the elements in the projected intermediate sequences. |
TResult | The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
collectionSelector | Expression | A transform function to apply to each element. |
resultSelector | Expression | A transform function to apply to each element of the intermediate sequence. |
Returns: IQbservable
Remarks
The projected sequences are enumerated synchronously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the ToObservable conversion.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or collectionSelector or resultSelector is null. |
4. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TCollection, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IEnumerable<TCollection>>> collectionSelector, Expression<Func<TSource, int, TCollection, int, TResult>> resultSelector)
Summary: Projects each element of an observable sequence to an enumerable sequence by incorporating the element's index, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TCollection | The type of the elements in the projected intermediate enumerable sequences. |
TResult | The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate sequence elements. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
collectionSelector | Expression | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
resultSelector | Expression | A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element and the fourth parameter represents the index of the intermediate element. |
Returns: IQbservable
Remarks
The projected sequences are enumerated synchronously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the ToObservable conversion.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or collectionSelector or resultSelector is null. |
5. Overload¶
public static IQbservable<TOther> SelectMany<TSource, TOther>(this IQbservable<TSource> source, IObservable<TOther> other)
Summary: Projects each element of the source observable sequence to the other observable sequence and merges the resulting observable sequences into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TOther | The type of the elements in the other sequence and the elements in the result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
other | IObservable | An observable sequence to project each element from the source sequence onto. |
Returns: IQbservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or other is null. |
6. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TResult>>> onNext, Expression<Func<Exception, IObservable<TResult>>> onError, Expression<Func<IObservable<TResult>>> onCompleted)
Summary: Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner sequences and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of notifications to project. |
onNext | Expression | A transform function to apply to each element. |
onError | Expression | A transform function to apply when an error occurs in the source sequence. |
onCompleted | Expression | A transform function to apply when the end of the source sequence is reached. |
Returns: IQbservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext or onError or onCompleted is null. |
7. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TResult>>> onNext, Expression<Func<Exception, IObservable<TResult>>> onError, Expression<Func<IObservable<TResult>>> onCompleted)
Summary: Projects each notification of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner sequences and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of notifications to project. |
onNext | Expression | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
onError | Expression | A transform function to apply when an error occurs in the source sequence. |
onCompleted | Expression | A transform function to apply when the end of the source sequence is reached. |
Returns: IQbservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or onNext or onError or onCompleted is null. |
8. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TResult>>> selector)
Summary: Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner sequences and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
selector | Expression | A transform function to apply to each element. |
Returns: IQbservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
9. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IObservable<TResult>>> selector)
Summary: Projects each element of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner sequences and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
selector | Expression | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Returns: IQbservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
10. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, Task<TResult>>> selector)
Summary: Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the result produced by the projected tasks and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
selector | Expression | A transform function to apply to each element. |
Returns: IQbservable
Remarks
This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
11. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, Task<TResult>>> selector)
Summary: Projects each element of an observable sequence to a task by incorporating the element's index and merges all of the task results into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the result produced by the projected tasks and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
selector | Expression | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Returns: IQbservable
Remarks
This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
12. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, CancellationToken, Task<TResult>>> selector)
Summary: Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the result produced by the projected tasks and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
selector | Expression | A transform function to apply to each element. |
Returns: IQbservable
Remarks
This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
13. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, CancellationToken, Task<TResult>>> selector)
Summary: Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support and merges all of the task results into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the result produced by the projected tasks and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
selector | Expression | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Returns: IQbservable
Remarks
This overload supports composition of observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
14. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, IEnumerable<TResult>>> selector)
Summary: Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
selector | Expression | A transform function to apply to each element. |
Returns: IQbservable
Remarks
The projected sequences are enumerated synchronously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the ToObservable conversion.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
15. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, IEnumerable<TResult>>> selector)
Summary: Projects each element of an observable sequence to an enumerable sequence by incorporating the element's index and concatenates the resulting enumerable sequences into one observable sequence.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the projected inner enumerable sequences and the elements in the merged result sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence of elements to project. |
selector | Expression | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
Returns: IQbservable
Remarks
The projected sequences are enumerated synchronously within the OnNext call of the source sequence. In order to do a concurrent, non-blocking merge, change the selector to return an observable sequence obtained using the ToObservable conversion.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
16. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, TTaskResult, TResult>> resultSelector)
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.
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 | [IQbservable | An observable sequence of elements to project. |
taskSelector | Expression | A transform function to apply to each element. |
resultSelector | Expression | A transform function to apply to each element of the intermediate sequence. |
Returns: IQbservable
Remarks
This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or taskSelector or resultSelector is null. |
17. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, int, TTaskResult, TResult>> resultSelector)
Summary: Projects each element of an observable sequence to a task by incorporating the element's index, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
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 | [IQbservable | An observable sequence of elements to project. |
taskSelector | Expression | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
resultSelector | Expression | A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element. |
Returns: IQbservable
Remarks
This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or taskSelector or resultSelector is null. |
18. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, CancellationToken, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, TTaskResult, TResult>> resultSelector)
Summary: Projects each element of an observable sequence to a task with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
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 | [IQbservable | An observable sequence of elements to project. |
taskSelector | Expression | A transform function to apply to each element. |
resultSelector | Expression | A transform function to apply to each element of the intermediate sequence. |
Returns: IQbservable
Remarks
This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or taskSelector or resultSelector is null. |
19. Overload¶
public static IQbservable<TResult> SelectMany<TSource, TTaskResult, TResult>(this IQbservable<TSource> source, Expression<Func<TSource, int, CancellationToken, Task<TTaskResult>>> taskSelector, Expression<Func<TSource, int, TTaskResult, TResult>> resultSelector)
Summary: Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
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 | [IQbservable | An observable sequence of elements to project. |
taskSelector | Expression | A transform function to apply to each element; the second parameter of the function represents the index of the source element. |
resultSelector | Expression | A transform function to apply to each element of the intermediate sequence; the second parameter of the function represents the index of the source element. |
Returns: IQbservable
Remarks
This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and tasks, without requiring manual conversion of the tasks to observable sequences using ToObservable.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or taskSelector or resultSelector is null. |