MigrationsSqlGenerator.Generate Method

Definition

Overloads

Generate(InsertDataOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given InsertDataOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(MigrationOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given MigrationOperation by making calls on the given MigrationCommandListBuilder.

Generate(RenameColumnOperation, IModel, MigrationCommandListBuilder)

Can be overridden by database providers to build commands for the given RenameColumnOperation by making calls on the given MigrationCommandListBuilder.

Generate(RenameIndexOperation, IModel, MigrationCommandListBuilder)

Can be overridden by database providers to build commands for the given RenameIndexOperation by making calls on the given MigrationCommandListBuilder.

Generate(RenameSequenceOperation, IModel, MigrationCommandListBuilder)

Can be overridden by database providers to build commands for the given RenameSequenceOperation by making calls on the given MigrationCommandListBuilder.

Generate(RenameTableOperation, IModel, MigrationCommandListBuilder)

Can be overridden by database providers to build commands for the given RenameTableOperation by making calls on the given MigrationCommandListBuilder.

Generate(RestartSequenceOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given RestartSequenceOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(SqlOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given SqlOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(UpdateDataOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given UpdateDataOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(IReadOnlyList<MigrationOperation>, IModel, MigrationsSqlGenerationOptions)

Generates commands from a list of operations.

Generate(AddColumnOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given AddColumnOperation by making calls on the given MigrationCommandListBuilder.

Generate(AddForeignKeyOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given AddForeignKeyOperation by making calls on the given MigrationCommandListBuilder.

Generate(AddPrimaryKeyOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given AddPrimaryKeyOperation by making calls on the given MigrationCommandListBuilder.

Generate(CreateIndexOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given CreateIndexOperation by making calls on the given MigrationCommandListBuilder.

Generate(CreateTableOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given CreateTableOperation by making calls on the given MigrationCommandListBuilder.

Generate(DropColumnOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given DropColumnOperation by making calls on the given MigrationCommandListBuilder.

Generate(DropForeignKeyOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given DropForeignKeyOperation by making calls on the given MigrationCommandListBuilder.

Generate(DropIndexOperation, IModel, MigrationCommandListBuilder, Boolean)

Can be overridden by database providers to build commands for the given DropIndexOperation by making calls on the given MigrationCommandListBuilder.

Generate(DropPrimaryKeyOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given DropPrimaryKeyOperation by making calls on the given MigrationCommandListBuilder.

Generate(DropTableOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given DropTableOperation by making calls on the given MigrationCommandListBuilder.

Generate(InsertDataOperation, IModel, MigrationCommandListBuilder, Boolean)

Builds commands for the given InsertDataOperation by making calls on the given MigrationCommandListBuilder.

Generate(EnsureSchemaOperation, IModel, MigrationCommandListBuilder)

Can be overridden by database providers to build commands for the given EnsureSchemaOperation by making calls on the given MigrationCommandListBuilder.

Generate(DropUniqueConstraintOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given DropUniqueConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(DropTableOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given DropTableOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(DropSequenceOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given DropSequenceOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(IReadOnlyList<MigrationOperation>, IModel)

Generates commands from a list of operations.

Generate(AddCheckConstraintOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given AddCheckConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(AddColumnOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given AddColumnOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(AddForeignKeyOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given AddForeignKeyOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(AddPrimaryKeyOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given AddPrimaryKeyOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(AddUniqueConstraintOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given AddUniqueConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(AlterColumnOperation, IModel, MigrationCommandListBuilder)

Can be overridden by database providers to build commands for the given AlterColumnOperation by making calls on the given MigrationCommandListBuilder.

Generate(AlterDatabaseOperation, IModel, MigrationCommandListBuilder)

Can be overridden by database providers to build commands for the given AlterDatabaseOperation by making calls on the given MigrationCommandListBuilder.

Generate(AlterSequenceOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given AlterSequenceOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(AlterTableOperation, IModel, MigrationCommandListBuilder)

Can be overridden by database providers to build commands for the given AlterTableOperation by making calls on the given MigrationCommandListBuilder.

Generate(CreateCheckConstraintOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given CreateCheckConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(CreateIndexOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given CreateIndexOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(CreateSequenceOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given CreateSequenceOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(CreateTableOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given CreateTableOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(DeleteDataOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given DeleteDataOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(DropCheckConstraintOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given DropCheckConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(DropColumnOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given DropColumnOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(DropForeignKeyOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given DropForeignKeyOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(DropIndexOperation, IModel, MigrationCommandListBuilder)

Can be overridden by database providers to build commands for the given DropIndexOperation by making calls on the given MigrationCommandListBuilder.

Note that the default implementation of this method throws NotImplementedException. Providers must override if they are to support this kind of operation.

Generate(DropPrimaryKeyOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given DropPrimaryKeyOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(DropSchemaOperation, IModel, MigrationCommandListBuilder)

Builds commands for the given DropSchemaOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

Generate(InsertDataOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given InsertDataOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
InsertDataOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 2.0, 2.1, 2.2

Generate(MigrationOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given MigrationOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
MigrationOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Remarks

This method uses a double-dispatch mechanism to call one of the 'Generate' methods that are specific to a certain subtype of MigrationOperation. Typically database providers will override these specific methods rather than this method. However, providers can override this methods to handle provider-specific operations.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(RenameColumnOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given RenameColumnOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RenameColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RenameColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
RenameColumnOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Remarks

Note that the default implementation of this method throws NotSupportedException. Providers must override if they are to support this kind of operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(RenameIndexOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given RenameIndexOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RenameIndexOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RenameIndexOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
RenameIndexOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Remarks

Note that the default implementation of this method throws NotSupportedException. Providers must override if they are to support this kind of operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(RenameSequenceOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given RenameSequenceOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RenameSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RenameSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
RenameSequenceOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Remarks

Note that the default implementation of this method throws NotSupportedException. Providers must override if they are to support this kind of operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(RenameTableOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given RenameTableOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RenameTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RenameTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
RenameTableOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Remarks

Note that the default implementation of this method throws NotSupportedException. Providers must override if they are to support this kind of operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(RestartSequenceOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given RestartSequenceOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RestartSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.RestartSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
RestartSequenceOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(SqlOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given SqlOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.SqlOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.SqlOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
SqlOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(UpdateDataOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given UpdateDataOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.UpdateDataOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.UpdateDataOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
UpdateDataOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(IReadOnlyList<MigrationOperation>, IModel, MigrationsSqlGenerationOptions)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Generates commands from a list of operations.

C#
public virtual System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Migrations.MigrationCommand> Generate (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation> operations, Microsoft.EntityFrameworkCore.Metadata.IModel model = default, Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerationOptions options = Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerationOptions.Default);
C#
public virtual System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Migrations.MigrationCommand> Generate (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation> operations, Microsoft.EntityFrameworkCore.Metadata.IModel? model = default, Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerationOptions options = Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerationOptions.Default);

Parameters

operations
IReadOnlyList<MigrationOperation>

The operations.

model
IModel

The target model which may be null if the operations exist without a model.

options
MigrationsSqlGenerationOptions

The options to use when generating commands.

Returns

The list of commands to be executed or scripted.

Implements

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 5.0, 6.0, 7.0, 8.0, 9.0

Generate(AddColumnOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given AddColumnOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
AddColumnOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(AddForeignKeyOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given AddForeignKeyOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
AddForeignKeyOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(AddPrimaryKeyOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given AddPrimaryKeyOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
AddPrimaryKeyOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(CreateIndexOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given CreateIndexOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
CreateIndexOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(CreateTableOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given CreateTableOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
CreateTableOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(DropColumnOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropColumnOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
DropColumnOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(DropForeignKeyOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropForeignKeyOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropForeignKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropForeignKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropForeignKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
DropForeignKeyOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(DropIndexOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given DropIndexOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropIndexOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropIndexOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
DropIndexOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Remarks

Note that the default implementation of this method throws NotSupportedException. Providers must override if they are to support this kind of operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(DropPrimaryKeyOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropPrimaryKeyOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropPrimaryKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropPrimaryKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropPrimaryKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
DropPrimaryKeyOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(DropTableOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropTableOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
DropTableOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(InsertDataOperation, IModel, MigrationCommandListBuilder, Boolean)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given InsertDataOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.InsertDataOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder, bool terminate = true);

Parameters

operation
InsertDataOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

terminate
Boolean

Indicates whether or not to terminate the command after generating SQL for the operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(EnsureSchemaOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given EnsureSchemaOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.EnsureSchemaOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.EnsureSchemaOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
EnsureSchemaOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Remarks

Note that the default implementation of this method throws NotSupportedException. Providers must override if they are to support this kind of operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(DropUniqueConstraintOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropUniqueConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropUniqueConstraintOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropUniqueConstraintOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DropUniqueConstraintOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(DropTableOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropTableOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DropTableOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(DropSequenceOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropSequenceOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DropSequenceOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(IReadOnlyList<MigrationOperation>, IModel)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Generates commands from a list of operations.

C#
public virtual System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Migrations.MigrationCommand> Generate (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Migrations.Operations.MigrationOperation> operations, Microsoft.EntityFrameworkCore.Metadata.IModel model = default);

Parameters

operations
IReadOnlyList<MigrationOperation>

The operations.

model
IModel

The target model which may be null if the operations exist without a model.

Returns

The list of commands to be executed or scripted.

Implements

Applies to

Entity Framework Core 3.1 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1

Generate(AddCheckConstraintOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given AddCheckConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddCheckConstraintOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddCheckConstraintOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
AddCheckConstraintOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 5.0, 6.0, 7.0, 8.0, 9.0

Generate(AddColumnOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given AddColumnOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
AddColumnOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(AddForeignKeyOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given AddForeignKeyOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddForeignKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
AddForeignKeyOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(AddPrimaryKeyOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given AddPrimaryKeyOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddPrimaryKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
AddPrimaryKeyOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(AddUniqueConstraintOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given AddUniqueConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AddUniqueConstraintOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
AddUniqueConstraintOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(AlterColumnOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given AlterColumnOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AlterColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
AlterColumnOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Remarks

Note that the default implementation of this method throws NotSupportedException. Providers must override if they are to support this kind of operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(AlterDatabaseOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given AlterDatabaseOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AlterDatabaseOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AlterDatabaseOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
AlterDatabaseOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Remarks

Note that there is no default implementation of this method. Providers must override if they are to support this kind of operation.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(AlterSequenceOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given AlterSequenceOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AlterSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AlterSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
AlterSequenceOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(AlterTableOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given AlterTableOperation by making calls on the given MigrationCommandListBuilder.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AlterTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.AlterTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
AlterTableOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Remarks

Note that the default implementation of this method does nothing because there is no common metadata relating to this operation. Providers only need to override this method if they have some provider-specific annotations that must be handled.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(CreateCheckConstraintOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given CreateCheckConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateCheckConstraintOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
CreateCheckConstraintOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 3.1 and Entity Framework Core 3.0
Product Versions
Entity Framework Core 3.0, 3.1

Generate(CreateIndexOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given CreateIndexOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateIndexOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
CreateIndexOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(CreateSequenceOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given CreateSequenceOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateSequenceOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
CreateSequenceOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(CreateTableOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given CreateTableOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.CreateTableOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
CreateTableOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(DeleteDataOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DeleteDataOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DeleteDataOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DeleteDataOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DeleteDataOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(DropCheckConstraintOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropCheckConstraintOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropCheckConstraintOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropCheckConstraintOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DropCheckConstraintOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Generate(DropColumnOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropColumnOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropColumnOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DropColumnOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(DropForeignKeyOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropForeignKeyOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropForeignKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DropForeignKeyOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(DropIndexOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Can be overridden by database providers to build commands for the given DropIndexOperation by making calls on the given MigrationCommandListBuilder.

Note that the default implementation of this method throws NotImplementedException. Providers must override if they are to support this kind of operation.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropIndexOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DropIndexOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(DropPrimaryKeyOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropPrimaryKeyOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropPrimaryKeyOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DropPrimaryKeyOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 2.2 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2

Generate(DropSchemaOperation, IModel, MigrationCommandListBuilder)

Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs
Source:
MigrationsSqlGenerator.cs

Builds commands for the given DropSchemaOperation by making calls on the given MigrationCommandListBuilder, and then terminates the final command.

C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropSchemaOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);
C#
protected virtual void Generate (Microsoft.EntityFrameworkCore.Migrations.Operations.DropSchemaOperation operation, Microsoft.EntityFrameworkCore.Metadata.IModel? model, Microsoft.EntityFrameworkCore.Migrations.MigrationCommandListBuilder builder);

Parameters

operation
DropSchemaOperation

The operation.

model
IModel

The target model which may be null if the operations exist without a model.

builder
MigrationCommandListBuilder

The command builder to use to build the commands.

Applies to

Entity Framework Core 9.0 and other versions
Product Versions
Entity Framework Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0