Пример #1
0
 /// <summary>
 /// Releases the unmanaged resources used by the <see cref="DbTransaction"/>.
 /// </summary>
 /// <param name="disposing">false if being called from a <c>finalizer</c></param>
 protected override void Dispose(bool disposing)
 {
     if (disposing && _transaction != null)
     {
         _transaction.Dispose();
     }
     _transaction = null;
     _connection  = null;
     base.Dispose(disposing);
 }
Пример #2
0
 /// <summary>
 /// Initialises a new instance of the <see cref="ProfiledDbTransaction"/> class.
 /// </summary>
 /// <param name="transaction">The transaction.</param>
 /// <param name="connection">The connection.</param>
 /// <exception cref="ArgumentNullException">Throws when the <paramref name="transaction"/> or <paramref name="connection"/> is <c>null</c>.</exception>
 public ProfiledDbTransaction(DbTransaction transaction, ProfiledDbConnection connection)
 {
     _transaction = transaction ?? throw new ArgumentNullException(nameof(transaction));
     _connection  = connection ?? throw new ArgumentNullException(nameof(connection));
 }