Summary
Adds an asynchronous action to be executed foreach item returned by the asynchronous items function.
This method will be executed the first time the task is executed.
Syntax
public static CakeTaskBuilder DoesForEach<TItem>(this CakeTaskBuilder builder, Func<ICakeContext, IAsyncEnumerable<TItem>> itemsFunc, Func<TItem, Task> action)
Examples
Task("Pack")
.DoesForEach(context => GetFrameworksAsync(), async tfm =>
{
await System.Threading.Tasks.Task.Delay(10);
Information("Packing {0}", tfm);
});
Type Parameters
| Name |
Description |
| TItem |
The item type. |
Parameters
| Name |
Type |
Description |
| builder |
CakeTaskBuilder |
The task builder. |
| itemsFunc |
Func<ICakeContext, IAsyncEnumerable<TItem>> |
The items. |
| action |
Func<TItem, Task> |
The action. |
Return Value