System.Transactions.Workflows
Système de transactions de code!
Un projet de code pour simplifier l'éxécution de tâches devant se compenser lorsque quelque chose brise après.
Exemple:
using (var context = new WorkflowContext())
{
context.Act(() => SomeMethodCall())
.CompensateWith(() => SomeOtherMethodCall())
.CancelWith(() => SomeOtherMethodCallAgain())
.Execute();
AThirdMethodCall();
context.Complete();
}