Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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();
         }
     }
 }
Ejemplo n.º 4
0
        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);
                }
            }
        }