Table of Contents

Class IAsyncEnumerableExtensions

Namespace
Garyon.Extensions
Assembly
Garyon.dll

Contains extension functions for the IAsyncEnumerable<T> interface.

public static class IAsyncEnumerableExtensions
Inheritance
IAsyncEnumerableExtensions
Inherited Members

Methods

FlattenAsync<T>(IAsyncEnumerable<IAsyncEnumerable<T>>)

Flattens an IAsyncEnumerable<T> of IAsyncEnumerable<T> into a single IAsyncEnumerable<T> asynchronously. The resulting elements are contained in the order they are enumerated.

public static IAsyncEnumerable<T> FlattenAsync<T>(this IAsyncEnumerable<IAsyncEnumerable<T>> source)

Parameters

source IAsyncEnumerable<IAsyncEnumerable<T>>

The collection of collections.

Returns

IAsyncEnumerable<T>

The flattened IAsyncEnumerable<T>.

Type Parameters

T

The type of elements contained in the collections.

FlattenAsync<T>(IAsyncEnumerable<IEnumerable<T>>)

Flattens an IAsyncEnumerable<T> of IEnumerable<T> into a single IAsyncEnumerable<T> asynchronously. The resulting elements are contained in the order they are enumerated.

public static IAsyncEnumerable<T> FlattenAsync<T>(this IAsyncEnumerable<IEnumerable<T>> source)

Parameters

source IAsyncEnumerable<IEnumerable<T>>

The collection of collections.

Returns

IAsyncEnumerable<T>

The flattened IAsyncEnumerable<T>.

Type Parameters

T

The type of elements contained in the collections.

FlattenAsync<T>(IEnumerable<IAsyncEnumerable<T>>)

Flattens an IEnumerable<T> of IAsyncEnumerable<T> into a single IAsyncEnumerable<T> asynchronously. The resulting elements are contained in the order they are enumerated.

public static IAsyncEnumerable<T> FlattenAsync<T>(this IEnumerable<IAsyncEnumerable<T>> source)

Parameters

source IEnumerable<IAsyncEnumerable<T>>

The collection of collections.

Returns

IAsyncEnumerable<T>

The flattened IAsyncEnumerable<T>.

Type Parameters

T

The type of elements contained in the collections.

ForEachAsync<T>(IAsyncEnumerable<T>, IndexedEnumeratedElementAction<T>)

Performs an action on each of the elements contained in the collection.

public static Task ForEachAsync<T>(this IAsyncEnumerable<T> source, IndexedEnumeratedElementAction<T> action)

Parameters

source IAsyncEnumerable<T>

The source collection.

action IndexedEnumeratedElementAction<T>

The action to perform on each of the elements.

Returns

Task

Type Parameters

T

The type of the elements that are contained in the collection.

ForEachAsync<T>(IAsyncEnumerable<T>, Action<T>)

Performs an action on each of the elements contained in the collection.

public static Task ForEachAsync<T>(this IAsyncEnumerable<T> source, Action<T> action)

Parameters

source IAsyncEnumerable<T>

The source collection.

action Action<T>

The action to perform on each of the elements.

Returns

Task

Type Parameters

T

The type of the elements that are contained in the collection.

ToListAsync<T>(IAsyncEnumerable<IEnumerable<T>>)

Enumerates the entire IAsyncEnumerable<T> collection and creates a list with the enumerated elements in the order they were enumerated.

public static Task<List<T>> ToListAsync<T>(this IAsyncEnumerable<IEnumerable<T>> source)

Parameters

source IAsyncEnumerable<IEnumerable<T>>

The source collection.

Returns

Task<List<T>>

A Task wrapping the new List<T> containing all the elements that were enumerated from the IAsyncEnumerable<T> collection.

Type Parameters

T

The type of the elements that are contained in the collection.

ToListAsync<T>(IAsyncEnumerable<T>)

Enumerates the entire IAsyncEnumerable<T> collection and creates a list with the enumerated elements in the order they were enumerated.

public static Task<List<T>> ToListAsync<T>(this IAsyncEnumerable<T> source)

Parameters

source IAsyncEnumerable<T>

The source collection.

Returns

Task<List<T>>

A Task wrapping the new List<T> containing all the elements that were enumerated from the IAsyncEnumerable<T> collection.

Type Parameters

T

The type of the elements that are contained in the collection.

WithIndex<T>(IAsyncEnumerable<T>)

Wraps the IAsyncEnumerable<T> into an IndexedAsyncEnumerable<T> for enumeration with index.

public static IndexedAsyncEnumerable<T> WithIndex<T>(this IAsyncEnumerable<T> enumerable)

Parameters

enumerable IAsyncEnumerable<T>

The IAsyncEnumerable<T> to enumerate with index.

Returns

IndexedAsyncEnumerable<T>

The IndexedAsyncEnumerable<T> that wraps the enumerable for indexed enumeration.

Type Parameters

T

The type of the elements that are contained in the collection.