Share via


MigrationsCodeGenerator Class

Definition

Used to generate code for migrations.

public abstract class MigrationsCodeGenerator
[System.Runtime.CompilerServices.Nullable(0)]
public abstract class MigrationsCodeGenerator : Microsoft.EntityFrameworkCore.Migrations.Design.IMigrationsCodeGenerator
public abstract class MigrationsCodeGenerator : Microsoft.EntityFrameworkCore.Migrations.Design.IMigrationsCodeGenerator
type MigrationsCodeGenerator = class
[<System.Runtime.CompilerServices.Nullable(0)>]
type MigrationsCodeGenerator = class
    interface IMigrationsCodeGenerator
    interface ILanguageBasedService
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
Attributes
Implements

Remarks

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

Constructors

Name Description
MigrationsCodeGenerator()
MigrationsCodeGenerator(MigrationsCodeGeneratorDependencies)

Initializes a new instance of the MigrationsCodeGenerator class.

Properties

Name Description
Dependencies

Dependencies for this service.

FileExtension

Gets the file extension code files should use.

Language

Gets the programming language supported by this service.

Methods

Name Description
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