/// <summary> /// Releases the unmanaged resources used by the <see cref="T:System.Data.Common.DbTransaction" /> and optionally releases the managed resources. /// </summary> /// <param name="disposing">If <see langword="true" />, this method releases all resources held by any managed objects that this <see cref="T:System.Data.Common.DbTransaction" /> references.</param> protected override void Dispose(bool disposing) { if (disposing) { trans?.Dispose(); } trans = null; db = null; base.Dispose(disposing); }
/// <summary> /// Initializes a new instance of the <see cref="ProfiledDbTransaction"/> class. /// </summary> /// <param name="transaction">The transaction.</param> /// <param name="connection">The connection.</param> /// <exception cref="System.ArgumentNullException">transaction</exception> /// <exception cref="System.ArgumentNullException">connection</exception> public ProfiledDbTransaction(DbTransaction transaction, ProfiledConnection connection) { this.trans = transaction ?? throw new ArgumentNullException(nameof(transaction)); this.db = connection ?? throw new ArgumentNullException(nameof(connection)); }