IMigrationsAssembly Interface

Definition

A service representing an assembly containing EF Core Migrations.

The service lifetime is Scoped. This means that each DbContext instance will use its own instance of this service. The implementation may depend on other services registered with any lifetime. The implementation does not need to be thread-safe.

public interface IMigrationsAssembly
type IMigrationsAssembly = interface
Public Interface IMigrationsAssembly

Remarks

See Database migrations for more information.

Properties

Assembly

The assembly that contains the migrations, snapshot, etc.

Migrations

A dictionary mapping migration identifiers to the TypeInfo of the class that represents the migration.

ModelSnapshot

The snapshot of the IModel contained in the assembly.

Methods

CreateMigration(TypeInfo, String)

Creates an instance of the migration class.

FindMigrationId(String)

Finds a migration identifier in the assembly with the given a full migration name or just its identifier.

Extension Methods

GetMigrationId(IMigrationsAssembly, String)

Gets a migration identifier in the assembly with the given a full migration name or just its identifier.

An exception is thrown if the migration was not found--use FindMigrationId(String) if the migration may not exist.

Applies to