Table of Contents

Class UpdateExpression

Namespace
Microsoft.EntityFrameworkCore.Query.SqlExpressions
Assembly
Microsoft.EntityFrameworkCore.Relational.dll

An expression that represents an UPDATE operation in a SQL tree.

This type is typically used by database providers (and other extensions). It is generally not used in application code.

public sealed class UpdateExpression : Expression, IPrintableExpression
Inheritance
UpdateExpression
Implements
IPrintableExpression
Inherited Members

Constructors

UpdateExpression(TableExpression, SelectExpression, IReadOnlyList<ColumnValueSetter>)

Creates a new instance of the UpdateExpression class.

public UpdateExpression(TableExpression table, SelectExpression selectExpression, IReadOnlyList<ColumnValueSetter> columnValueSetters)

Parameters

table TableExpression

A table on which the update operation is being applied.

selectExpression SelectExpression

A select expression which is used to determine which rows to update and to get data from additional tables.

columnValueSetters IReadOnlyList<ColumnValueSetter>

A list of ColumnValueSetter which specifies columns and their corresponding values to update.

Properties

ColumnValueSetters

The list of ColumnValueSetter which specifies columns and their corresponding values to update.

public IReadOnlyList<ColumnValueSetter> ColumnValueSetters { get; }

Property Value

IReadOnlyList<ColumnValueSetter>

NodeType

public override ExpressionType NodeType { get; }

Property Value

ExpressionType

SelectExpression

The select expression which is used to determine which rows to update and to get data from additional tables.

public SelectExpression SelectExpression { get; }

Property Value

SelectExpression

Table

The table on which the update operation is being applied.

public TableExpression Table { get; }

Property Value

TableExpression

Tags

The list of tags applied to this UpdateExpression.

public ISet<string> Tags { get; }

Property Value

ISet<string>

Type

public override Type Type { get; }

Property Value

Type

Methods

ApplyTags(ISet<string>)

Applies a given set of tags.

public UpdateExpression ApplyTags(ISet<string> tags)

Parameters

tags ISet<string>

A list of tags to apply.

Returns

UpdateExpression

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Print(ExpressionPrinter)

public void Print(ExpressionPrinter expressionPrinter)

Parameters

expressionPrinter ExpressionPrinter

Update(SelectExpression, IReadOnlyList<ColumnValueSetter>)

Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.

public UpdateExpression Update(SelectExpression selectExpression, IReadOnlyList<ColumnValueSetter> columnValueSetters)

Parameters

selectExpression SelectExpression

The SelectExpression property of the result.

columnValueSetters IReadOnlyList<ColumnValueSetter>

The ColumnValueSetters property of the result.

Returns

UpdateExpression

This expression if no children changed, or an expression with the updated children.

VisitChildren(ExpressionVisitor)

protected override Expression VisitChildren(ExpressionVisitor visitor)

Parameters

visitor ExpressionVisitor

Returns

Expression