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
stringThe migration name.
Returns
- string
The identifier.
GetName(string)
Gets a migration name based on the given identifier.
string GetName(string id)
Parameters
id
stringThe 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
stringThe candidate string.