Skip to content

Commit 02341c3

Browse files
author
electricessence
authored
Update README.md
1 parent b49e3f1 commit 02341c3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,22 @@ Depending on the level of asynchrony in your application, you may want to avoid
103103
`ResultsAsync<T>()` is fully asynchronous from end-to-end but returns an `IEnumerable<T>` that although has fully buffered the all the data into memory, has deferred the transformation until enumerated. This way, the asynchronous data pipeline is fully complete before synchronously transforming the data.
104104

105105
Both methods ultimately are using a `Queue<object[]>` or `ConcurrentQueue<object[]>` (Dataflow) to buffer the data, but `ResultsAsync<T>()` buffers the entire data set before dequeuing and transforming the results.
106+
107+
## Transactions
108+
109+
Example:
110+
111+
```cs
112+
// Returns true if the transaction is successful.
113+
public static bool DoTransaction()
114+
=> ConnectionFactory.Using(connection =>
115+
// Open a connection and start a transaction.
116+
connection.ExecuteTransactionConditional(c => {
117+
/*
118+
* Do some complex data access requring a potential roll-back.
119+
*/
120+
121+
// Commit transation if true. Roll-back if false.
122+
return true;
123+
}));
124+
```

0 commit comments

Comments
 (0)