Exemplo n.º 1
0
        private void Dispose(bool disposing)
        {
            var doThrowTransactionException = false;

            if (_transaction != null)
            {
                _context.AbortTransaction();
                _transaction.Dispose();
                doThrowTransactionException = true;
            }

            if (!isDisposed && disposing && _context != null)
            {
                _context.Dispose();
            }

            isDisposed = true;

            if (doThrowTransactionException)
            {
                throw new DataException("Transaction was aborted");
            }
        }