PrepareSendCommand() 공개 메소드

public PrepareSendCommand ( SqlCommand command ) : void
command SqlCommand
리턴 void
        async Task SendRawMessage(MessageRow message, SqlConnection connection, SqlTransaction transaction, CancellationToken cancellationToken)
        {
            try
            {
                var sendCommand = await GetSendCommandText(connection, transaction, cancellationToken).ConfigureAwait(false);

                using (var command = new SqlCommand(sendCommand, connection, transaction))
                {
                    message.PrepareSendCommand(command);

                    await command.ExecuteNonQueryAsync(cancellationToken).ConfigureAwait(false);
                }
            }
            // 207 = Invalid column name
            // 515 = Cannot insert the value NULL into column; column does not allow nulls
            catch (SqlException ex) when((ex.Number == 207 || ex.Number == 515) && ex.Message.Contains("Recoverable"))
            {
                cachedSendCommand = null;
                throw new Exception($"Failed to send message to {qualifiedTableName} due to a change in the existence of the Recoverable column that is scheduled for removal. If the table schema has changed, this is expected. Retrying the message send will detect the new table structure and adapt to it.", ex);
            }
            catch (SqlException ex) when(ex.Number == 208)
            {
                ThrowQueueNotFoundException(ex);
            }
            catch (Exception ex) when(!ex.IsCausedBy(cancellationToken))
            {
                ThrowFailedToSendException(ex);
            }
        }
        async Task SendRawMessage(MessageRow message, SqlConnection connection, SqlTransaction transaction)
        {
            try
            {
                using (var command = new SqlCommand(sendCommand, connection, transaction))
                {
                    message.PrepareSendCommand(command);

                    await command.ExecuteNonQueryAsync().ConfigureAwait(false);
                }
            }
            catch (SqlException ex)
            {
                if (ex.Number == 208)
                {
                    ThrowQueueNotFoundException(ex);
                }

                ThrowFailedToSendException(ex);
            }
            catch (Exception ex)
            {
                ThrowFailedToSendException(ex);
            }
        }