MigrationCommand Class

Definition

Represents a command ready to be sent to the database to migrate it.

public class MigrationCommand
type MigrationCommand = class
Public Class MigrationCommand
Inheritance
MigrationCommand

Remarks

See Database migrations for more information and examples.

Constructors

MigrationCommand(IRelationalCommand, Boolean)

Creates a new instance of the command.

MigrationCommand(IRelationalCommand, DbContext, IDiagnosticsLogger<DbLoggerCategory.Database.Command>, Boolean)

Creates a new instance of the command.

MigrationCommand(IRelationalCommand, DbContext, IRelationalCommandDiagnosticsLogger, Boolean)

Creates a new instance of the command.

Properties

CommandLogger

The associated command logger.

CommandText

The SQL command text that will be executed against the database.

TransactionSuppressed

Indicates whether or not transactions should be suppressed while executing the command.

Methods

ExecuteNonQuery(IRelationalConnection, IReadOnlyDictionary<String,Object>)

Executes the command and returns the number of rows affected.

ExecuteNonQuery(IRelationalConnection, IReadOnlyDictionary<String,Object>, Boolean)
ExecuteNonQueryAsync(IRelationalConnection, IReadOnlyDictionary<String,Object>, Boolean, CancellationToken)
ExecuteNonQueryAsync(IRelationalConnection, IReadOnlyDictionary<String,Object>, CancellationToken)

Executes the command and returns the number of rows affected.

Applies to