/// <summary> /// Create an empty or nested <see cref="IDbTransactionScope"/> with <see cref="DbScopeConfig.DefaultTransactionIsolationLevel"/> when creating empty, /// otherwise for nested the provided <paramref name="transactionScope"/>'s IsolationLevel is inherited. /// </summary> /// <param name="transactionScope"> /// If null a new <see cref="IDbTransactionScope"/> is returned; otherwise nested. /// </param> public IDbTransactionScope CreateTransactionScope(IDbTransactionScope transactionScope) { if (transactionScope == null) { return(new DbTransactionScope(DbScopeConfig.DefaultTransactionIsolationLevel)); } else { return(transactionScope.BeginNested()); } }
/// <summary> /// Create an empty or nested <see cref="IDbTransactionScope"/> with provided <paramref name="isolationLevel"/>. /// </summary> /// <param name="transactionScope">If null a new <see cref="IDbTransactionScope"/> is returned; otherwise nested.</param> /// <param name="isolationLevel"></param> /// <exception cref="DbTransactionScopeException"> /// If the provided IsolationLevel is different than the provided <paramref name="transactionScope"/>'s IsolationLevel. /// </exception> public IDbTransactionScope CreateTransactionScope(IDbTransactionScope transactionScope, System.Transactions.IsolationLevel isolationLevel) { if (transactionScope == null) { return(new DbTransactionScope(isolationLevel)); } else { return(transactionScope.BeginNested(isolationLevel)); } }