Table of Contents

Interface IMigrationsIdGenerator

Namespace
Microsoft.EntityFrameworkCore.Migrations
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

A service for generating migration identifiers from names and names from identifiers.

The service lifetime is Singleton. This means a single instance is used by many Microsoft.EntityFrameworkCore.DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.

public interface IMigrationsIdGenerator

Methods

GenerateId(string)

Generates an identifier given a migration name.

string GenerateId(string name)

Parameters

name string

The migration name.

Returns

string

The identifier.

GetName(string)

Gets a migration name based on the given identifier.

string GetName(string id)

Parameters

id string

The migration identifier.

Returns

string

The migration name.

IsValidId(string)

Checks whether or not the given string is a valid migration identifier.

bool IsValidId(string value)

Parameters

value string

The candidate string.

Returns

bool

true if the string is a valid migration identifier; false otherwise.