Class PgBinaryExpression
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.dll
An expression that represents a PostgreSQL-specific binary operation in a SQL tree.
public class PgBinaryExpression : SqlExpression, IRelationalQuotableExpression, IPrintableExpression
- Inheritance
-
PgBinaryExpression
- Implements
- Inherited Members
Constructors
PgBinaryExpression(PgExpressionType, SqlExpression, SqlExpression, Type, RelationalTypeMapping?)
Creates a new instance of the PgBinaryExpression class.
public PgBinaryExpression(PgExpressionType operatorType, SqlExpression left, SqlExpression right, Type type, RelationalTypeMapping? typeMapping)
Parameters
operatorType
PgExpressionTypeThe operator to apply.
left
SqlExpressionAn expression which is left operand.
right
SqlExpressionAn expression which is right operand.
type
TypeThe Type of the expression.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
Properties
Left
The left operand.
public virtual SqlExpression Left { get; }
Property Value
OperatorType
The operator of this PostgreSQL binary operation.
public virtual PgExpressionType OperatorType { get; }
Property Value
Right
The right operand.
public virtual SqlExpression Right { get; }
Property Value
Methods
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Print(ExpressionPrinter)
Creates a printable string representation of the given expression using ExpressionPrinter.
protected override void Print(ExpressionPrinter expressionPrinter)
Parameters
expressionPrinter
ExpressionPrinterThe expression printer to use.
Quote()
Quotes the expression; that is, returns an expression that, when evaluated, would construct an expression identical to this one. Used to generate code for precompiled queries, which reconstructs this expression.
public override Expression Quote()
Returns
Update(SqlExpression, SqlExpression)
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 PgBinaryExpression Update(SqlExpression left, SqlExpression right)
Parameters
left
SqlExpressionThe Left property of the result.
right
SqlExpressionThe Right property of the result.
Returns
- PgBinaryExpression
This expression if no children changed, or an expression with the updated children.
VisitChildren(ExpressionVisitor)
Reduces the node and then calls the visitor delegate on the reduced expression. The method throws an exception if the node is not reducible.
protected override Expression VisitChildren(ExpressionVisitor visitor)
Parameters
visitor
ExpressionVisitorAn instance of Func<T, TResult>.
Returns
- Expression
The expression being visited, or an expression which should replace it in the tree.