IMigrationCommandExecutor 介面
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
針對資料庫執行移轉命令的服務。
public interface IMigrationCommandExecutor
type IMigrationCommandExecutor = interface
Public Interface IMigrationCommandExecutor
備註
服務存留期為 Singleton 。 這表示許多實例都會使用 DbContext 單一實例。 實作必須是安全線程。 此服務無法相依于註冊為 Scoped 的服務。
如需詳細資訊和範例 ,請參閱資料庫移轉 。
方法
ExecuteNonQuery(IEnumerable<MigrationCommand>, IRelationalConnection) |
使用指定的資料庫連接來執行指定的命令。 |
ExecuteNonQueryAsync(IEnumerable<MigrationCommand>, IRelationalConnection, CancellationToken) |
使用指定的資料庫連接來執行指定的命令。 |
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應