RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade) RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade) Method

Definition

Applies any pending migrations for the context to the database. Will create the database if it does not already exist.

Note that this API is mutually exclusive with DbContext.Database.EnsureCreated(). EnsureCreated does not use migrations to create the database and therefore the database that is created cannot be later updated using migrations.

public static void Migrate (this Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade databaseFacade);
static member Migrate : Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade -> unit

Parameters

databaseFacade
DatabaseFacade DatabaseFacade

The DatabaseFacade for the context.

Applies to