SuperLinq SuperLinq
SuperLinq SuperLinq
DocFX + Singulink = ♥

Search Results for

    Method CopyTo

    CopyTo<TSource>(IAsyncEnumerable<TSource>, IList<TSource>, CancellationToken)

    Copies the contents of a sequence into a provided list.

    Declaration
    public static ValueTask<int> CopyTo<TSource>(this IAsyncEnumerable<TSource> source, IList<TSource> list, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IAsyncEnumerable<TSource> source

    The source sequence.

    IList<TSource> list

    The list that is the destination of the elements copied from source.

    CancellationToken cancellationToken

    The CancellationToken in use.

    Returns
    Type Description
    ValueTask<int>

    The number of elements actually copied.

    Type Parameters
    Name Description
    TSource

    The type of elements of source

    Remarks

    All data from source will be copied to list, starting at position 0.

    This operator executes immediately.

    Exceptions
    Type Condition
    ArgumentNullException

    source is null.

    ArgumentNullException

    list is null.

    CopyTo<TSource>(IAsyncEnumerable<TSource>, IList<TSource>, int, CancellationToken)

    Copies the contents of a sequence into a provided list.

    Declaration
    public static ValueTask<int> CopyTo<TSource>(this IAsyncEnumerable<TSource> source, IList<TSource> list, int index, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    IAsyncEnumerable<TSource> source

    The source sequence.

    IList<TSource> list

    The list that is the destination of the elements copied from source.

    int index

    The position in list at which to start copying data

    CancellationToken cancellationToken

    The CancellationToken in use.

    Returns
    Type Description
    ValueTask<int>

    The number of elements actually copied.

    Type Parameters
    Name Description
    TSource

    The type of elements of source

    Remarks

    All data from source will be copied to list, starting at position index.

    This operator executes immediately.

    Exceptions
    Type Condition
    ArgumentNullException

    source is null.

    ArgumentNullException

    list is null.

    © SuperLinq Authors. All rights reserved.