Share via


MigrationsCodeGenerator Class

Definition

Used to generate code for migrations.

public abstract class MigrationsCodeGenerator
public abstract class MigrationsCodeGenerator : Microsoft.EntityFrameworkCore.Migrations.Design.IMigrationsCodeGenerator
type MigrationsCodeGenerator = class
type MigrationsCodeGenerator = class
    interface IMigrationsCodeGenerator
type MigrationsCodeGenerator = class
    interface IMigrationsCodeGenerator
    interface ILanguageBasedService
Public MustInherit Class MigrationsCodeGenerator
Public MustInherit Class MigrationsCodeGenerator
Implements IMigrationsCodeGenerator
Inheritance
MigrationsCodeGenerator
Derived
Implements

Remarks

See Database migrations, and EF Core design-time services for more information and examples.

Constructors

MigrationsCodeGenerator()
MigrationsCodeGenerator(MigrationsCodeGeneratorDependencies)

Initializes a new instance of the MigrationsCodeGenerator class.

Properties

Dependencies

Dependencies for this service.

FileExtension

Gets the file extension code files should use.

Language

Gets the programming language supported by this service.

Methods

GenerateMetadata(String, Type, String, String, IModel)

Generates the migration metadata code.

GenerateMigration(String, String, IReadOnlyList<MigrationOperation>, IReadOnlyList<MigrationOperation>)

Generates the migration code.

GenerateSnapshot(String, Type, String, IModel)

Generates the model snapshot code.

GetNamespaces(IEnumerable<MigrationOperation>)

Gets the namespaces required for a list of MigrationOperation objects.

GetNamespaces(IModel)

Gets the namespaces required for an IModel.

Applies to