SqlScripter.Core/src/Data/SqlCommon.cs
/// <summary>
/// If a SqlCommand does not have a transaction new Transaction is started.
/// </summary>
/// <param name="sqlCmd">A command to whitch transaction will be assigned</param>
/// <param name="isolation">A transaction <see cref="IsolationLevel"/>.</param>
If a SqlCommand does not have a transaction new Transaction is started.
If a SqlCommand does not have a transaction new Transaction is started .
private static void EnsureOpenTransaction(SqlCommand sqlCmd, IsolationLevel isolation) {
            if (sqlCmd.Transaction == null) {
                sqlCmd.Transaction = sqlCmd.Connection.BeginTransaction(isolation);
            } else {
                if (sqlCmd.Transaction.Connection == null) {
                    throw new InvalidOperationException("Current transaction have been closed");
                }
            }
        }
private static void EnsureOpenTransaction ( SqlCommand sqlCmd , IsolationLevel isolation ) { if ( sqlCmd . Transaction == null ) { sqlCmd . Transaction = sqlCmd . Connection . BeginTransaction ( isolation ) ; } else { if ( sqlCmd . Transaction . Connection == null ) { throw new InvalidOperationException ( " " ) ; } } }
If a SqlCommand does not have a transaction new Transaction is started.
If a SqlCommand does not have a transaction new Transaction is started .
sqlCmd
SqlCommand
A command to whitch transaction will be assigned
A command to whitch transaction will be assigned
isolation
IsolationLevel
A transaction .
A transaction .