Class EnumerableExtensions
Extension methods on
Inheritance
System.Object
EnumerableExtensions
Namespace: DNVGL.One.Compute.Core.Extensions
Assembly: DNVGL.One.Compute.Core.dll
Syntax
public static class EnumerableExtensions : object
Methods
View SourceForEachAsync<T>(IEnumerable<T>, Func<T, Task>, Int32)
Execute the given action on every element in the source collection in parallel, with a given degree of parallelism (max. number of parallel tasks).
Declaration
public static Task ForEachAsync<T>(this IEnumerable<T> source, Func<T, Task> action, int degreeOfParallelism = 10)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | source | The source collection. |
Func<T, Task> | action | The action to execute on each element in the source collection. |
System.Int32 | degreeOfParallelism | The degree of parallelism. Default is 10. |
Returns
Type | Description |
---|---|
Task | Async task |
Type Parameters
Name | Description |
---|---|
T | Element type |