Skip to content

Frosting: How to get a behavior similar to ".WithCriteria()"? #2951

Answered by patriksvensson
bergziege asked this question in Q&A
Discussion options

You must be logged in to vote

@bergziege You can override the ShouldRun method in the task to accomplish this.

[Dependency(typeof(Build))]
public sealed class MyTask : FrostingTask<Context>
{
    public override bool ShouldRun(Context context)
    {
        // Criteria here
        return true;
    }

    public override void Run(Context context)
    {
    }
}

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@pascalberger
Comment options

@arturcic
Comment options

@pascalberger
Comment options

@WebDucer
Comment options

Answer selected by patriksvensson
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants