共用方式為


IMigrator.Migrate(String) 方法

定義

將資料庫移轉至指定的目標移轉,或最多存在於 中 IMigrationsAssembly 的最新移轉。

public void Migrate (string targetMigration = default);
public void Migrate (string? targetMigration = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Migration generation currently isn't compatible with trimming")]
public void Migrate (string? targetMigration = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Migration generation currently isn't compatible with trimming")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT")]
public void Migrate (string? targetMigration = default);
abstract member Migrate : string -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Migration generation currently isn't compatible with trimming")>]
abstract member Migrate : string -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Migration generation currently isn't compatible with trimming")>]
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT")>]
abstract member Migrate : string -> unit
Public Sub Migrate (Optional targetMigration As String = Nothing)

參數

targetMigration
String

要移轉資料庫的目標移轉,或 null 移轉至最新版本。

屬性

備註

如需詳細資訊和範例 ,請參閱資料庫移 轉。

適用於