Class ExecuteSqlStatementExpression
Represents a migration expression that executes a specified raw SQL statement. This is typically used to perform custom database operations during a migration.
Namespace: Umbraco.Cms.Infrastructure.Migrations.Expressions.Execute.Expressions
Assembly: Umbraco.Infrastructure.dll
Syntax
public class ExecuteSqlStatementExpression : MigrationExpressionBase, IMigrationExpression
Constructors
View SourceExecuteSqlStatementExpression(IMigrationContext)
Initializes a new instance of the ExecuteSqlStatementExpression class with the specified migration context.
Declaration
public ExecuteSqlStatementExpression(IMigrationContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| IMigrationContext | context | The IMigrationContext to use for the migration operation. |
Properties
View SourceSqlObject
Gets or sets the SQL object that represents the SQL statement to be executed.
Declaration
public virtual Sql<ISqlContext>? SqlObject { get; set; }
Property Value
| Type | Description |
|---|---|
| Sql<ISqlContext> |
SqlStatement
Gets or sets the SQL statement to be executed.
Declaration
public virtual string? SqlStatement { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
View SourceExecuteSqlObject()
Executes the SQL statement encapsulated in the SqlObject property.
Declaration
public void ExecuteSqlObject()
GetSql()
Declaration
protected override string? GetSql()
Returns
| Type | Description |
|---|---|
| string |