<PackageReference Include="AsyncEnumerator" Version="2.0.1" />

System.Collections.Async.IAsyncEnumeratorExtensions

public static class IAsyncEnumeratorExtensions
Extension methods for IAsyncEnumerator<T> interface
public static Task<TSource> FirstAsync<TSource>(this IAsyncEnumerator<TSource> source, CancellationToken token = default, bool disposeSource = true)

Returns the first element in the IAsyncEnumerator<T>.

public static Task<TSource> FirstAsync<TSource>(this IAsyncEnumerator<TSource> source, Func<TSource, bool> predicate, CancellationToken token = default, bool disposeSource = true)

Returns the first element in a sequence that satisfies a specified condition.

public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncEnumerator<TSource> source, CancellationToken token = default, bool disposeSource = true)

Returns the first element in the IAsyncEnumerator<T>, or a default value if no element is found.

public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncEnumerator<TSource> source, Func<TSource, bool> predicate, CancellationToken token = default, bool disposeSource = true)

Returns the first element in a sequence that satisfies a specified condition, or a default value if no element is found.

public static IAsyncEnumerator<TResult> Select<TSource, TResult>(this IAsyncEnumerator<TSource> source, Func<TSource, TResult> selector, bool disposeSource = true)

Projects each element of a sequence into a new form.

public static IAsyncEnumerator<TResult> Select<TSource, TResult>(this IAsyncEnumerator<TSource> source, Func<TSource, long, TResult> selector, bool disposeSource = true)

Projects each element of a sequence into a new form.

public static IAsyncEnumerator<TSource> Skip<TSource>(this IAsyncEnumerator<TSource> source, int count, bool disposeSource = true)

An IAsyncEnumerator<T> to return elements from.

public static IAsyncEnumerator<TSource> SkipWhile<TSource>(this IAsyncEnumerator<TSource> source, Func<TSource, bool> predicate, bool disposeSource = true)

Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.

public static IAsyncEnumerator<TSource> Take<TSource>(this IAsyncEnumerator<TSource> source, int count, bool disposeSource = true)

Returns a specified number of contiguous elements from the start of a sequence.

public static IAsyncEnumerator<TSource> TakeWhile<TSource>(this IAsyncEnumerator<TSource> source, Func<TSource, bool> predicate, bool disposeSource = true)

Returns elements from a sequence as long as a specified condition is true.

public static Task<T[]> ToArrayAsync<T>(this IAsyncEnumerator<T> source, CancellationToken cancellationToken = default, bool disposeSource = true)

Creates an array of elements asynchronously from the enumerable source

public static Task<List<T>> ToListAsync<T>(this IAsyncEnumerator<T> source, CancellationToken cancellationToken = default, bool disposeSource = true)

Creates a list of elements asynchronously from the enumerable source

public static IAsyncEnumerator<TSource> Where<TSource>(this IAsyncEnumerator<TSource> source, Func<TSource, bool> predicate, bool disposeSource = true)

Filters a sequence of values based on a predicate.

public static IAsyncEnumerator<TSource> Where<TSource>(this IAsyncEnumerator<TSource> source, Func<TSource, long, bool> predicate, bool disposeSource = true)

Projects each element of a sequence into a new form.