CakeTaskBuilderOfTExtensions.

WithCriteria<TData>(CakeTaskBuilder<TData>, Func<ICakeContext, TData, bool>, string) Method

Summary

Adds a criteria that has to be fulfilled for the task to run. The criteria is evaluated when traversal of the graph occurs.
Namespace
Cake.Core
Containing Type
CakeTaskBuilderOfTExtensions

Syntax

public static CakeTaskBuilder<TData> WithCriteria<TData>(this CakeTaskBuilder<TData> builder, Func<ICakeContext, TData, bool> criteria, string message) 
    where TData : class

Type Parameters

Name Description
TData The type of the data context.

Parameters

Name Type Description
builder CakeTaskBuilder<TData> The task builder.
criteria Func<ICakeContext, TData, bool> The criteria.
message string The message to display if the task was skipped due to the provided criteria.

Return Value

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