资 源 简 介
MOVED TO GITHUB: https://github.com/cdroulers/system-transactions
A very basic framework to handle transactions in an environment where they aren"t available (such as a multiple back-end manager).
It would be used to declare code lines that can be rolled back if a transaction fails. The goal is to take out the basics of the CompensableActivity from Windows Workflow Foundation and make it more fluent and easier to debug.
```
using (var context = new WorkflowContext())
{
context.Act(() => SomeMethodCall())
.CompensateWith(() => SomeOtherMethodCall())
.CancelWith(() => SomeOtherMethodCallAgain())
.Execute();
AThirdMethodCall();
context.Complete();
}
```
In the previous code, if SomeMethodCall() throws an exception, SomeOtherMethodCallAgain() will be executed, and the exception will be