Provides extension methods for asynchronous enumeration of collections.
public static class EnumerableExtensions
Task<int> CountAsync(this IEnumerable<T> source, CancellationToken cancellationToken = null)Summary: Asynchronously counts the elements in a sequence.
Parameters:
source
- The source sequence to count.
cancellationToken
- A to observe while waiting for the asynchronous operation to complete.Returns: A task that represents the asynchronous operation. The task result contains the number of elements in the sequence.
IAsyncEnumerable<T> ToAsyncEnumerable(this IEnumerable<T> source, CancellationToken cancellationToken = null)Summary: Converts an
System.Collections.Generic.IEnumerable
1to an
System.Collections.Generic.IAsyncEnumerable1
.Parameters:
source
- The source sequence to convert.
cancellationToken
- A to observe while waiting for the asynchronous operation to complete.Returns: An
System.Collections.Generic.IAsyncEnumerable
1` that contains the elements from the input sequence.
Task<List<T>> ToListAsync(this IEnumerable<T> source, CancellationToken cancellationToken = null)Summary: Asynchronously creates a
System.Collections.Generic.List
1from an
System.Collections.Generic.IEnumerable1
.Parameters:
source
- The source sequence to convert to a list.
cancellationToken
- A to observe while waiting for the asynchronous operation to complete.Returns: A task that represents the asynchronous operation. The task result contains a list with the elements from the input sequence.
public static class ReadOnlyListExtensions
IEnumerable<IEnumerable<T>> GetPowerSet(this IReadOnlyList<T> list)
IEnumerable<IEnumerable<string>> GetUniqueCombinations(this IReadOnlyList<string> list)
IEnumerable<string> GetUniqueCombinationsAsCommaSeparated(this IReadOnlyList<string> list)