Share via


CSharpMigrationsGenerator Class

Definition

Used to generate C# code for migrations.

public class CSharpMigrationsGenerator : Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsCodeGenerator
type CSharpMigrationsGenerator = class
    inherit MigrationsCodeGenerator
Public Class CSharpMigrationsGenerator
Inherits MigrationsCodeGenerator
Inheritance
CSharpMigrationsGenerator

Remarks

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

Constructors

CSharpMigrationsGenerator(CSharpHelper, CSharpMigrationOperationGenerator, CSharpSnapshotGenerator)
CSharpMigrationsGenerator(MigrationsCodeGeneratorDependencies, CSharpMigrationsGeneratorDependencies)

Initializes a new instance of the CSharpMigrationsGenerator class.

Properties

CSharpDependencies

Dependencies for this service.

Dependencies

Dependencies for this service.

(Inherited from MigrationsCodeGenerator)
FileExtension

Gets the file extension code files should use.

Language

Gets the programming language supported by this service.

Language

Gets the programming language supported by this service.

(Inherited from MigrationsCodeGenerator)

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.

(Inherited from MigrationsCodeGenerator)
GetNamespaces(IModel)

Gets the namespaces required for an IModel.

(Inherited from MigrationsCodeGenerator)

Applies to