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
sourceIAsyncEnumerable<IAsyncEnumerable<T>>The collection of collections.
Returns
- IAsyncEnumerable<T>
The flattened IAsyncEnumerable<T>.
Type Parameters
TThe 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
sourceIAsyncEnumerable<IEnumerable<T>>The collection of collections.
Returns
- IAsyncEnumerable<T>
The flattened IAsyncEnumerable<T>.
Type Parameters
TThe 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
sourceIEnumerable<IAsyncEnumerable<T>>The collection of collections.
Returns
- IAsyncEnumerable<T>
The flattened IAsyncEnumerable<T>.
Type Parameters
TThe 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
sourceIAsyncEnumerable<T>The source collection.
actionIndexedEnumeratedElementAction<T>The action to perform on each of the elements.
Returns
Type Parameters
TThe 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
sourceIAsyncEnumerable<T>The source collection.
actionAction<T>The action to perform on each of the elements.
Returns
Type Parameters
TThe 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
sourceIAsyncEnumerable<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
TThe 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
sourceIAsyncEnumerable<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
TThe 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
enumerableIAsyncEnumerable<T>The IAsyncEnumerable<T> to enumerate with index.
Returns
- IndexedAsyncEnumerable<T>
The IndexedAsyncEnumerable<T> that wraps the
enumerablefor indexed enumeration.
Type Parameters
TThe type of the elements that are contained in the collection.