Example #1
0
        /// <summary>
        /// 进入一个事务上下文
        /// </summary>
        /// <param name="transaction">要进入的事务</param>
        /// <returns>事务上下文</returns>
        public static IDbTransactionContext EnterTransaction(IDbTransactionContext transaction)
        {
            if (transaction == null)
            {
                throw new ArgumentNullException(nameof(transaction));
            }


            transaction.RegisterDispose(DbContext.EnterContext(transaction));
            transaction.BeginTransaction();

            return(transaction);
        }
Example #2
0
 public void BeginTransaction() => _context.BeginTransaction();