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 不使用迁移来创建数据库,因此以后无法使用迁移更新所创建的数据库。

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

适用于