Class PgArraySliceExpression
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.dll
A SQL expression that represents a slicing into a PostgreSQL array (e.g. array[2:3]).
public class PgArraySliceExpression : SqlExpression, IPrintableExpression, IEquatable<PgArraySliceExpression>
- Inheritance
-
PgArraySliceExpression
- Implements
- Inherited Members
Remarks
Constructors
PgArraySliceExpression(SqlExpression, SqlExpression?, SqlExpression?, bool, Type, RelationalTypeMapping?)
Creates a new instance of the PgArraySliceExpression class.
public PgArraySliceExpression(SqlExpression array, SqlExpression? lowerBound, SqlExpression? upperBound, bool nullable, Type type, RelationalTypeMapping? typeMapping)
Parameters
arraySqlExpressionThe array tp slice into.
lowerBoundSqlExpressionThe lower bound of the slice.
upperBoundSqlExpressionThe upper bound of the slice.
nullableboolWhether the expression is nullable.
typeTypeThe Type of the expression.
typeMappingRelationalTypeMappingThe RelationalTypeMapping associated with the expression.
Properties
Array
The array being sliced.
public virtual SqlExpression Array { get; }
Property Value
IsNullable
Whether the expression is nullable.
public virtual bool IsNullable { get; }
Property Value
LowerBound
The lower bound of the slice.
public virtual SqlExpression? LowerBound { get; }
Property Value
UpperBound
The upper bound of the slice.
public virtual SqlExpression? UpperBound { get; }
Property Value
Methods
Equals(PgArraySliceExpression?)
Indicates whether the current object is equal to another object of the same type.
public virtual bool Equals(PgArraySliceExpression? other)
Parameters
otherPgArraySliceExpressionAn 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
objobjectThe 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
expressionPrinterExpressionPrinterThe expression printer to use.
ToString()
Returns a textual representation of the Expression.
public override string ToString()
Returns
- string
A textual representation of the Expression.
Update(SqlExpression, 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 PgArraySliceExpression Update(SqlExpression array, SqlExpression? lowerBound, SqlExpression? upperBound)
Parameters
arraySqlExpressionThe Array property of the result.
lowerBoundSqlExpressionThe lower bound of the slice.
upperBoundSqlExpressionThe upper bound of the slice.
Returns
- PgArraySliceExpression
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
visitorExpressionVisitorAn instance of Func<T, TResult>.
Returns
- Expression
The expression being visited, or an expression which should replace it in the tree.