CakeTaskBuilderExtensions.

DoesForEach<TItem>(CakeTaskBuilder, IAsyncEnumerable<TItem>, Action<TItem, ICakeContext>) Method

Summary

Adds an action to be executed foreach item in the asynchronous list. This method will be executed the first time the task is executed.
Namespace
Cake.Core
Containing Type
CakeTaskBuilderExtensions

Syntax

public static CakeTaskBuilder DoesForEach<TItem>(this CakeTaskBuilder builder, IAsyncEnumerable<TItem> items, Action<TItem, ICakeContext> action)

Examples

Task("Pack")
    .DoesForEach(GetFrameworksAsync(), (tfm, context) =>
{
    context.Log.Information("Packing {0}", tfm);
});

Type Parameters

Name Description
TItem The item type.

Parameters

Name Type Description
builder CakeTaskBuilder The task builder.
items IAsyncEnumerable<TItem> The items.
action Action<TItem, ICakeContext> The action.

Return Value

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