共用方式為


RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade) 方法

定義

將內容的任何擱置移轉套用至資料庫。 如果資料庫不存在,將會建立資料庫。

public static void Migrate (this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT Use a migration bundle or an alternate way of executing migration operations.")]
public static void Migrate (this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade);
static member Migrate : Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade -> unit
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Migrations operations are not supported with NativeAOT Use a migration bundle or an alternate way of executing migration operations.")>]
static member Migrate : Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade -> unit
<Extension()>
Public Sub Migrate (databaseFacade As DatabaseFacade)

參數

databaseFacade
DatabaseFacade

DatabaseFacade內容的 。

屬性

備註

請注意,此 API 與 互斥 EnsureCreated() 。 EnsureCreated 不會使用移轉來建立資料庫,因此無法稍後使用移轉來更新所建立的資料庫。

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

適用於