public TResult Transaction <TResult>(Func <ITransactionWrapper, TResult> action) { // todo:[kk] Transactions is too complex for in-memory storage, that's why we've just skip it for this type of storage var transactionWrapper = new DefaultTransactionWrapper(null, null, this); return(action(transactionWrapper)); }
public void Transaction(Action <ITransactionWrapper> action) { // todo:[kk] Transactions is too complex for in-memory storage, that's why we've just skip it for this type of storage var transactionWrapper = new DefaultTransactionWrapper(null, null, this); action(transactionWrapper); }
public void Transaction(Action <ITransactionWrapper> action) { using (var connection = CreateConnection()) { connection.Open(); using (var transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted)) { var transactionWrapper = new DefaultTransactionWrapper(connection, transaction, this); action(transactionWrapper); transaction.Commit(); } } }
public TResult Transaction <TResult>(Func <ITransactionWrapper, TResult> action) { using (var connection = CreateConnection()) { connection.Open(); using (var transaction = connection.BeginTransaction(IsolationLevel.ReadCommitted)) { var transactionWrapper = new DefaultTransactionWrapper(connection, transaction, this); var result = action(transactionWrapper); transaction.Commit(); return(result); } } }