语言

MigrationCommand 类

定义

表示准备发送到数据库的命令以迁移该命令。

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
继承
MigrationCommand
特性

注解

有关详细信息和示例,请参阅 数据库迁移 。

构造函数

名称 说明
MigrationCommand(IRelationalCommand, Boolean)

创建命令的新实例。

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

创建命令的新实例。

MigrationCommand(IRelationalCommand, DbContext, IRelationalCommandDiagnosticsLogger, Boolean)

创建命令的新实例。

属性

名称 说明
CommandLogger

关联的命令记录器。

CommandText

将针对数据库执行的 SQL 命令文本。

TransactionSuppressed

指示在执行命令时是否应禁止事务。

方法

名称 说明
ExecuteNonQuery(IRelationalConnection, IReadOnlyDictionary<String,Object>, Boolean)

表示准备发送到数据库的命令以迁移该命令。

ExecuteNonQuery(IRelationalConnection, IReadOnlyDictionary<String,Object>)

执行命令并返回受影响的行数。

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

表示准备发送到数据库的命令以迁移该命令。

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

执行命令并返回受影响的行数。

适用于