Share via


Observable.Select<TSource, TResult> Method (IObservable<TSource>, Func<TSource, Int32, TResult>)

Projects each element of an observable sequence into a new form by incorporating the element’s index with the specified source and selector.

Namespace:  System.Reactive.Linq
Assembly:  System.Reactive (in System.Reactive.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function Select(Of TSource, TResult) ( _
    source As IObservable(Of TSource), _
    selector As Func(Of TSource, Integer, TResult) _
) As IObservable(Of TResult)
'Usage
Dim source As IObservable(Of TSource)
Dim selector As Func(Of TSource, Integer, TResult)
Dim returnValue As IObservable(Of TResult)

returnValue = source.Select(selector)
public static IObservable<TResult> Select<TSource, TResult>(
    this IObservable<TSource> source,
    Func<TSource, int, TResult> selector
)
[ExtensionAttribute]
public:
generic<typename TSource, typename TResult>
static IObservable<TResult>^ Select(
    IObservable<TSource>^ source, 
    Func<TSource, int, TResult>^ selector
)
static member Select : 
        source:IObservable<'TSource> * 
        selector:Func<'TSource, int, 'TResult> -> IObservable<'TResult> 
JScript does not support generic types and methods.

Type Parameters

  • TSource
    The type of source.
  • TResult
    The type of result.

Parameters

  • source
    Type: System.IObservable<TSource>
    A sequence of elements to invoke a transform function on.
  • selector
    Type: System.Func<TSource, Int32, TResult>
    A transform function to apply to each source element.

Return Value

Type: System.IObservable<TResult>
An observable sequence into a new form.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IObservable<TSource>. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

See Also

Reference

Observable Class

Select Overload

System.Reactive.Linq Namespace