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
TableExpressionA table on which the update operation is being applied.
selectExpression
SelectExpressionA 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
NodeType
public override ExpressionType NodeType { get; }
Property Value
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
Table
The table on which the update operation is being applied.
public TableExpression Table { get; }
Property Value
Tags
The list of tags applied to this UpdateExpression.
public ISet<string> Tags { get; }
Property Value
Type
public override Type Type { get; }
Property Value
Methods
ApplyTags(ISet<string>)
Applies a given set of tags.
public UpdateExpression ApplyTags(ISet<string> tags)
Parameters
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
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
SelectExpressionThe 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