Executes a function within a transaction.
If the function completes successfully, the transaction is committed. If an error is thrown, the transaction is rolled back.
The function to execute within the transaction
The result of the transaction function
Unit of Work pattern for managing transactions.
Ensures that a group of operations either all succeed or all fail together.
Example