Interface IMigrationsAssembly
- Namespace
- Microsoft.EntityFrameworkCore.Migrations
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
A service representing an assembly containing EF Core Migrations.
The service lifetime is Scoped. This means that each Microsoft.EntityFrameworkCore.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
- Extension Methods
Properties
Assembly
The assembly that contains the migrations, snapshot, etc.
Assembly Assembly { get; }
Property Value
Migrations
A dictionary mapping migration identifiers to the TypeInfo of the class that represents the migration.
IReadOnlyDictionary<string, TypeInfo> Migrations { get; }
Property Value
ModelSnapshot
The snapshot of the Microsoft.EntityFrameworkCore.Metadata.IModel contained in the assembly.
ModelSnapshot ModelSnapshot { get; }
Property Value
Methods
CreateMigration(TypeInfo, string)
Creates an instance of the migration class.
Migration CreateMigration(TypeInfo migrationClass, string activeProvider)
Parameters
migrationClass
TypeInfoThe TypeInfo for the migration class, as obtained from the Migrations dictionary.
activeProvider
stringThe name of the current database provider.
Returns
- Migration
The migration instance.
FindMigrationId(string)
Finds a migration identifier in the assembly with the given a full migration name or just its identifier.
string FindMigrationId(string nameOrId)
Parameters
nameOrId
stringThe name or identifier to lookup.