,System.Func{--0,--1})} ,System.Func{--0,System.Int32,--1})}
Observable.Select(IObservable, Func) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObservable<TResult> Select<TSource, TResult>(this IObservable<TSource> source, Func<TSource, TResult> selector) - 2.
public static IObservable<TResult> Select<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, TResult> selector)
1. Overload¶
public static IObservable<TResult> Select<TSource, TResult>(this IObservable<TSource> source, Func<TSource, TResult> selector)
Summary: Projects each element of an observable sequence into a new form.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | A sequence of elements to invoke a transform function on. |
selector | Func | A transform function to apply to each source element. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |
2. Overload¶
public static IObservable<TResult> Select<TSource, TResult>(this IObservable<TSource> source, Func<TSource, int, TResult> selector)
Summary: Projects each element of an observable sequence into a new form by incorporating the element's index.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TResult | The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | A sequence of elements to invoke a transform function on. |
selector | Func | A transform function to apply to each source element; the second parameter of the function represents the index of the source element. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or selector is null. |