MigrationBuilder.Sql(String, Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework