MigrationBuilder.Sql(String, Boolean) Method

Definition

Builds an SqlOperation to execute raw SQL.

public virtual Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.SqlOperation> Sql (string sql, bool suppressTransaction = false);
abstract member Sql : string * bool -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.SqlOperation>
override this.Sql : string * bool -> Microsoft.EntityFrameworkCore.Migrations.Operations.Builders.OperationBuilder<Microsoft.EntityFrameworkCore.Migrations.Operations.SqlOperation>
Public Overridable Function Sql (sql As String, Optional suppressTransaction As Boolean = false) As OperationBuilder(Of SqlOperation)

Parameters

sql
String

The SQL string to be executed to perform the operation.

suppressTransaction
Boolean

Indicates whether or not transactions will be suppressed while executing the SQL.

Returns

A builder to allow annotations to be added to the operation.

Remarks

See Database migrations for more information and examples.

Applies to