Table of Contents

Class UnionExpression

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

An expression that represents a UNION 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 class UnionExpression : SetOperationBase, IPrintableExpression
Inheritance
UnionExpression
Implements
IPrintableExpression
Inherited Members

Constructors

UnionExpression(string, SelectExpression, SelectExpression, bool)

Creates a new instance of the UnionExpression class.

public UnionExpression(string alias, SelectExpression source1, SelectExpression source2, bool distinct)

Parameters

alias string

A string alias for the table source.

source1 SelectExpression

A table source which is first source in the set operation.

source2 SelectExpression

A table source which is second source in the set operation.

distinct bool

A bool value indicating whether result will remove duplicate rows.

Methods

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Print(ExpressionPrinter)

protected override void Print(ExpressionPrinter expressionPrinter)

Parameters

expressionPrinter ExpressionPrinter

Update(SelectExpression, SelectExpression)

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 virtual UnionExpression Update(SelectExpression source1, SelectExpression source2)

Parameters

source1 SelectExpression

The Source1 property of the result.

source2 SelectExpression

The Source2 property of the result.

Returns

UnionExpression

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