語言

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
屬性

備註

更多資訊與範例請參見 資料庫遷移 。

建構函式

名稱 Description
MigrationCommand(IRelationalCommand, Boolean)

建立一個新的指令實例。

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

建立一個新的指令實例。

MigrationCommand(IRelationalCommand, DbContext, IRelationalCommandDiagnosticsLogger, Boolean)

建立一個新的指令實例。

屬性

名稱 Description
CommandLogger

相關的指令記錄器。

CommandText

就是要對資料庫執行的 SQL 指令文字。

TransactionSuppressed

指示執行指令時是否應該抑制交易。

方法

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

代表一個準備傳送到資料庫以進行遷移的指令。

ExecuteNonQuery(IRelationalConnection, IReadOnlyDictionary<String,Object>)

執行指令並回傳受影響的列數。

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

代表一個準備傳送到資料庫以進行遷移的指令。

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

執行指令並回傳受影響的列數。

適用於