SuperLinq SuperLinq
SuperLinq SuperLinq
DocFX + Singulink = ♥

Search Results for

    Method BindByIndex

    BindByIndex<TSource>(IAsyncEnumerable<TSource>, IAsyncEnumerable<int>)

    Selects elements by index from a sequence.

    Declaration
    public static IAsyncEnumerable<TSource> BindByIndex<TSource>(this IAsyncEnumerable<TSource> source, IAsyncEnumerable<int> indices)
    Parameters
    Type Name Description
    IAsyncEnumerable<TSource> source

    The source sequence.

    IAsyncEnumerable<int> indices

    The list of indices of elements in the source sequence to select.

    Returns
    Type Description
    IAsyncEnumerable<TSource>

    An IAsyncEnumerable<T> whose elements are the result of selecting elements according to the indices sequence.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    Exceptions
    Type Condition
    ArgumentNullException

    source is null.

    ArgumentNullException

    indices is null.

    ArgumentOutOfRangeException

    An index in indices is out of range for the input sequence source.

    BindByIndex<TSource, TResult>(IAsyncEnumerable<TSource>, IAsyncEnumerable<int>, Func<TSource, int, TResult>, Func<int, TResult>)

    Selects elements by index from a sequence and transforms them using the provided functions.

    Declaration
    public static IAsyncEnumerable<TResult> BindByIndex<TSource, TResult>(this IAsyncEnumerable<TSource> source, IAsyncEnumerable<int> indices, Func<TSource, int, TResult> resultSelector, Func<int, TResult> missingSelector)
    Parameters
    Type Name Description
    IAsyncEnumerable<TSource> source

    The source sequence.

    IAsyncEnumerable<int> indices

    The list of indices of elements in the source sequence to select.

    Func<TSource, int, TResult> resultSelector

    A transform function to apply to each source element; the second parameter of the function represents the index of the output sequence.

    Func<int, TResult> missingSelector

    A transform function to apply to missing source elements; the parameter represents the index of the output sequence.

    Returns
    Type Description
    IAsyncEnumerable<TResult>

    An IAsyncEnumerable<T> whose elements are the result of selecting elements according to the indices sequence and invoking the transform function.

    Type Parameters
    Name Description
    TSource

    The type of the elements of source.

    TResult

    The type of the elements of the resulting sequence.

    Remarks

    This method uses deferred execution and streams its results.

    Exceptions
    Type Condition
    ArgumentNullException

    source is null.

    ArgumentNullException

    indices is null.

    ArgumentNullException

    resultSelector is null.

    ArgumentNullException

    missingSelector is null.

    © SuperLinq Authors. All rights reserved.