Summary
Adds an asynchronous action to be executed foreach item in the list.
Syntax
public static CakeTaskBuilder DoesForEach<TData, TItem>(this CakeTaskBuilder builder, IEnumerable<TItem> items, Func<TData, TItem, ICakeContext, Task> action)
where TData : class
Examples
Task("Pack")
.DoesForEach<Foo, string>(new[] { "net10.0" }, async (data, tfm, context) =>
{
await System.Threading.Tasks.Task.Delay(10);
context.Log.Information("Packing {0} for {1}", tfm, data.Place);
});
Type Parameters
| Name |
Description |
| TData |
The type of the data context. |
| TItem |
The item type. |
Parameters
| Name |
Type |
Description |
| builder |
CakeTaskBuilder |
The task builder. |
| items |
IEnumerable<TItem> |
The items. |
| action |
Func<TData, TItem, ICakeContext, Task> |
The action. |
Return Value