Class IEnumerableExtensions
Extension methods for System.Collections.Generic.IEnumerable<T> types.
Inheritance
System.Object
IEnumerableExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: CrashCABN.Shared
Assembly: CrashCABN.Shared.dll
Syntax
public static class IEnumerableExtensions
Methods
View SourceIterateWhileAsync<T>(IEnumerable<T>, Func<T, Task<Boolean>>, CancellationToken)
Performs a function on each item in an enumeration using async tasks in a task pool safe manner.
Declaration
public static Task IterateWhileAsync<T>(this IEnumerable<T> source, Func<T, Task<bool>> func, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | source | The collection to iterate on. |
System.Func<T, System.Threading.Tasks.Task<System.Boolean>> | func | The function to call for each item. Return true to continue execution. False to terminate further loops. |
System.Threading.CancellationToken | cancellationToken | An optional cancellation token source for early termination. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task representing the work to iterate over an enumeration. |
Type Parameters
Name | Description |
---|---|
T | The type to enumerate. |