Beispiel #1
0
        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
            this.Transaction?.Dispose();
            this.Transaction = null;

            this.Connector?.PopTransaction();
            this.Connector = null;
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MySqlDatabaseTransaction"/> class.
 /// </summary>
 /// <param name="transaction">The transaction.</param>
 /// <param name="connector">The database connector.</param>
 /// <exception cref="System.ArgumentNullException">transaction can not be null.</exception>
 internal MySqlDatabaseTransaction(MySqlTransaction transaction, MySqlDatabaseConnector connector)
 {
     this.Transaction = transaction ?? throw new ArgumentNullException(nameof(transaction), $"{nameof(transaction)} can not be null.");
     this.Connector   = connector;
 }