Skip to content

Terminate Rules

Arif Yayalar (@ayayalar) edited this page Aug 24, 2018 · 1 revision

Terminates the execution of the remaining rules.

Caution with Async/Parallel rule(s). It may not work as expected due to the nature of parallelism. Consider using ParallelConfiguration option with Parallel rules.
Example
class IsValidAmount : Rule<Order>
{   
    public override IRuleResult Invoke()
    {
        if (Model.Amount <= 0.0m) Configuration.Terminate = true;
        
        return null;
    }     
}