CakeTaskBuilderExtensions.

Does(CakeTaskBuilder, Func<ICakeContext, Task>) Method

Summary

Adds an action to be executed when the task is invoked.
Namespace
Cake.Core
Containing Type
CakeTaskBuilderExtensions

Syntax

public static CakeTaskBuilder Does(this CakeTaskBuilder builder, Func<ICakeContext, Task> func)

Examples

Task("Hello")
    .Does(async context =>
{
    await System.Threading.Tasks.Task.Delay(100);
    context.Log.Information("Hello World");
});

Parameters

Name Type Description
builder CakeTaskBuilder The task builder.
func Func<ICakeContext, Task> The action.

Return Value

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