public void Process(ExpenseData expense) { using (ProcessContext contex = new ProcessContext()) { foreach (var processStep in steps) { bool shouldContinue = processStep.Process(expense, contex); if (!shouldContinue) { HandlePartialResult(contex); } } HandleCompleteResult(contex, expense); } }
public void AdditionalExpenses(ExpenseData additional) { // ... additionalExpenses.Add(additional); }
public void Approve(ExpenseData expense) { }
private void HandleCompleteResult(ProcessContext contex, ExpenseData expense) { }