Share via


MigrationsAssemblyExtensions.GetMigrationId Method

Definition

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

public static string GetMigrationId (this Microsoft.EntityFrameworkCore.Migrations.IMigrationsAssembly assembly, string nameOrId);
static member GetMigrationId : Microsoft.EntityFrameworkCore.Migrations.IMigrationsAssembly * string -> string
<Extension()>
Public Function GetMigrationId (assembly As IMigrationsAssembly, nameOrId As String) As String

Parameters

assembly
IMigrationsAssembly

The assembly.

nameOrId
String

The name or identifier to lookup.

Returns

The identifier of the migration.

Remarks

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

See Database migrations for more information and examples.

Applies to