protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                SqlTransactionScope?.Dispose();

                SqlTransactionScope = null;
            }
        }
        public ITransactionScope BeginTransaction()
        {
            Debug.Assert(SqlTransactionScope == null, "The existing SQL transaction scope should be completed before starting a new transaction.");

            if (SqlTransactionScope != null)
            {
                throw new TransactionFailedException(Resources.TransactionProcessingException, HttpStatusCode.InternalServerError);
            }

            SqlTransactionScope = new SqlTransactionScope(this);

            return(SqlTransactionScope);
        }