CakeTaskBuilderExtensions.

DoesForEach<TItem>(CakeTaskBuilder, IEnumerable<TItem>, Func<TItem, ICakeContext, Task>) Method

Summary

Adds an asynchronous action to be executed foreach item in the list.
Namespace
Cake.Core
Containing Type
CakeTaskBuilderExtensions

Syntax

public static CakeTaskBuilder DoesForEach<TItem>(this CakeTaskBuilder builder, IEnumerable<TItem> items, Func<TItem, ICakeContext, Task> action)

Examples

Task("Pack")
    .DoesForEach(new[] { "net10.0" }, async (tfm, context) =>
{
    await System.Threading.Tasks.Task.Delay(10);
    context.Log.Information("Packing {0}", tfm);
});

Type Parameters

Name Description
TItem The item type.

Parameters

Name Type Description
builder CakeTaskBuilder The task builder.
items IEnumerable<TItem> The items.
action Func<TItem, ICakeContext, Task> The action.

Return Value

Type Description
CakeTaskBuilder The same CakeTaskBuilder instance so that multiple calls can be chained.