src/EFCore.MySql/Storage/Internal/MySqlRelationalConnection.cs
/// <summary>
///     Specifies an existing <see cref="DbTransaction" /> to be used for database operations.
/// </summary>
/// <param name="transaction"> The transaction to be used. </param>
Specifies an existing  to be used for database operations.
Specifies an existing to be used for database operations .
public override IDbContextTransaction UseTransaction(DbTransaction transaction)
        {
            if (transaction == null)
            {
                if (CurrentTransaction != null)
                {
                    CurrentTransaction = null;
                }
            }
            else
            {
                if (CurrentTransaction != null)
                {
                    throw new InvalidOperationException(RelationalStrings.TransactionAlreadyStarted);
                }
                Open();
                CurrentTransaction = new MySqlRelationalTransaction(
                    this, 
                    transaction, 
                    Dependencies.TransactionLogger, 
                    transactionOwned: false);
                Dependencies.TransactionLogger.TransactionUsed(
                    this, 
                    transaction, 
                    CurrentTransaction.TransactionId,
                    DateTimeOffset.UtcNow);
            }
            return CurrentTransaction;
        }
public override IDbContextTransaction UseTransaction ( DbTransaction transaction ) { if ( transaction == null ) { if ( CurrentTransaction != null ) { CurrentTransaction = null ; } } else { if ( CurrentTransaction != null ) { throw new InvalidOperationException ( RelationalStrings . TransactionAlreadyStarted ) ; } Open ( ) ; CurrentTransaction = new MySqlRelationalTransaction ( this , transaction , Dependencies . TransactionLogger , transactionOwned : false ) ; Dependencies . TransactionLogger . TransactionUsed ( this , transaction , CurrentTransaction . TransactionId , DateTimeOffset . UtcNow ) ; } return CurrentTransaction ; }
Specifies an existing  to be used for database operations.
Specifies an existing to be used for database operations .
transaction
DbTransaction
The transaction to be used.
The transaction to be used .