public DatabaseTransaction(IDbConnection connection) { if (_currentTransaction != null) return; _transaction = connection.BeginTransaction(); _currentTransaction = this; }
public DatabaseTransaction(IDbConnection connection) { if (_currentTransaction != null) { return; } _transaction = connection.BeginTransaction(); _currentTransaction = this; }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (_transaction != null) { // if we are here, the Commit() was not called _transaction.Rollback(); _transaction.Dispose(); } if (_currentTransaction == this) { _currentTransaction = null; } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (_transaction != null) { // if we are here, the Commit() was not called _transaction.Rollback(); _transaction.Dispose(); } if (_currentTransaction == this) _currentTransaction = null; }