Share via


MigrationCommand Class

Definition

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

public class MigrationCommand
[System.Runtime.CompilerServices.Nullable(0)]
public class MigrationCommand
type MigrationCommand = class
[<System.Runtime.CompilerServices.Nullable(0)>]
type MigrationCommand = class
Public Class MigrationCommand
Inheritance
MigrationCommand
Attributes

Remarks

See Database migrations for more information and examples.

Constructors

Name Description
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

Name Description
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

Name Description
ExecuteNonQuery(IRelationalConnection, IReadOnlyDictionary<String,Object>, Boolean)
ExecuteNonQuery(IRelationalConnection, IReadOnlyDictionary<String,Object>)

Executes the command and returns the number of rows affected.

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