Class UpdateDataBuilder
Provides a fluent builder for constructing expressions that update data within database migrations. Use this builder to specify the table, columns, and values to update as part of a migration step.
Namespace: Umbraco.Cms.Infrastructure.Migrations.Expressions.Update
Assembly: Umbraco.Infrastructure.dll
Syntax
public class UpdateDataBuilder : ExpressionBuilderBase<UpdateDataExpression>, IUpdateTableBuilder, IUpdateWhereBuilder, IExecutableBuilder
Constructors
View SourceUpdateDataBuilder(UpdateDataExpression)
Initializes a new instance of the UpdateDataBuilder class with the specified update data expression.
Declaration
public UpdateDataBuilder(UpdateDataExpression expression)
Parameters
| Type | Name | Description |
|---|---|---|
| UpdateDataExpression | expression | The UpdateDataExpression that defines the data to be updated in the migration. |
Methods
View SourceAllRows()
Specifies that the update operation should affect all rows in the target table.
Declaration
public IExecutableBuilder AllRows()
Returns
| Type | Description |
|---|---|
| IExecutableBuilder | An IExecutableBuilder that can be used to execute the update operation. |
Do()
Executes.
Declaration
public void Do()
Set(object)
Specifies the data.
Declaration
public IUpdateWhereBuilder Set(object dataAsAnonymousType)
Parameters
| Type | Name | Description |
|---|---|---|
| object | dataAsAnonymousType |
Returns
| Type | Description |
|---|---|
| IUpdateWhereBuilder |
Where(object)
Specifies the data to update for the selected rows.
Declaration
public IExecutableBuilder Where(object dataAsAnonymousType)
Parameters
| Type | Name | Description |
|---|---|---|
| object | dataAsAnonymousType | An anonymous type object containing the column values to update. |
Returns
| Type | Description |
|---|---|
| IExecutableBuilder | An IExecutableBuilder that can be used to execute the update operation. |