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

System.Collections.Async.IAsyncEnumerableExtensions

public static class IAsyncEnumerableExtensions
Extension methods for IAsyncEnumerable<T> interface
public static Task<TSource> FirstAsync<TSource>(this IAsyncEnumerable<TSource> source, CancellationToken token = default)

Returns the first element in the IAsyncEnumerable<T>.

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

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

public static Task<TSource> FirstOrDefaultAsync<TSource>(this IAsyncEnumerable<TSource> source, CancellationToken token = default)

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

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

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

public static IAsyncEnumerable<TResult> Select<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, TResult> selector)

Projects each element of a sequence into a new form.

public static IAsyncEnumerable<TResult> Select<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, long, TResult> selector)

Projects each element of a sequence into a new form.

public static IAsyncEnumerable<TSource> Skip<TSource>(this IAsyncEnumerable<TSource> source, int count)

An IAsyncEnumerable<T> to return elements from.

public static IAsyncEnumerable<TSource> SkipWhile<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, bool> predicate)

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

public static IAsyncEnumerable<TSource> Take<TSource>(this IAsyncEnumerable<TSource> source, int count)

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

public static IAsyncEnumerable<TSource> TakeWhile<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, bool> predicate)

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

public static Task<T[]> ToArrayAsync<T>(this IAsyncEnumerable<T> source, CancellationToken cancellationToken = default)

Creates an array of elements asynchronously from the enumerable source

public static Task<List<T>> ToListAsync<T>(this IAsyncEnumerable<T> source, CancellationToken cancellationToken = default)

Creates a list of elements asynchronously from the enumerable source

public static IAsyncEnumerable<TSource> Where<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, bool> predicate)

Filters a sequence of values based on a predicate.

public static IAsyncEnumerable<TSource> Where<TSource>(this IAsyncEnumerable<TSource> source, Func<TSource, long, bool> predicate)

Projects each element of a sequence into a new form.