Skip to content

,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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence.

Parameters

NameTypeDescription
sourceIObservableA sequence of elements to invoke a transform function on.
selectorFuncA transform function to apply to each source element.

Returns: IObservable -- An observable sequence whose elements are the result of invoking the transform function on each element of source.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource 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

NameDescription
TSourceThe type of the elements in the source sequence.
TResultThe type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence.

Parameters

NameTypeDescription
sourceIObservableA sequence of elements to invoke a transform function on.
selectorFuncA transform function to apply to each source element; the second parameter of the function represents the index of the source element.

Returns: IObservable -- An observable sequence whose elements are the result of invoking the transform function on each element of source.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or selector is null.