Class PgArrayIndexExpression
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.dll
An SQL expression that represents an indexing into a PostgreSQL array.
public class PgArrayIndexExpression : SqlExpression, IRelationalQuotableExpression, IPrintableExpression, IEquatable<PgArrayIndexExpression>
- Inheritance
-
PgArrayIndexExpression
- Implements
- Inherited Members
Remarks
SqlBinaryExpression specifically disallows having an OperatorType of value ArrayIndex as arrays are a PostgreSQL-only feature.
Constructors
PgArrayIndexExpression(SqlExpression, SqlExpression, bool, Type, RelationalTypeMapping?)
Creates a new instance of the PgArrayIndexExpression class.
public PgArrayIndexExpression(SqlExpression array, SqlExpression index, bool nullable, Type type, RelationalTypeMapping? typeMapping)
Parameters
array
SqlExpressionThe array tp index into.
index
SqlExpressionAn position in the array to index into.
nullable
boolWhether the expression is nullable.
type
TypeThe Type of the expression.
typeMapping
RelationalTypeMappingThe RelationalTypeMapping associated with the expression.
Properties
Array
The array being indexed.
public virtual SqlExpression Array { get; }
Property Value
Index
The index in the array.
public virtual SqlExpression Index { get; }
Property Value
IsNullable
Whether the expression is nullable.
public virtual bool IsNullable { get; }
Property Value
Methods
Equals(PgArrayIndexExpression?)
Indicates whether the current object is equal to another object of the same type.
public virtual bool Equals(PgArrayIndexExpression? other)
Parameters
other
PgArrayIndexExpressionAn object to compare with this object.
Returns
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
ToString()
Returns a textual representation of the Expression.
public override string ToString()
Returns
- string
A textual representation of the Expression.
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 PgArrayIndexExpression Update(SqlExpression array, SqlExpression index)
Parameters
array
SqlExpressionThe Array property of the result.
index
SqlExpressionThe Index property of the result.
Returns
- PgArrayIndexExpression
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.