public void Process(ExpenseData expense) { using (ProcessContext context = new ProcessContext()) { foreach (var processStep in steps) { bool shouldContinue = processStep.Process(expense, context); if (!shouldContinue) { HandlePartialResult(context); } } HandleCompleteResult(context, expense); } }
private void HandlePartialResult(ProcessContext context) { }
private void HandleCompleteResult(ProcessContext context, ExpenseData expense) { }