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