Table of Contents

Class PgJsonTraversalExpression

Namespace
Npgsql.EntityFrameworkCore.PostgreSQL.Query.Expressions.Internal
Assembly
Npgsql.EntityFrameworkCore.PostgreSQL.dll

Represents a PostgreSQL JSON operator traversing a JSON document with a path (i.e. x#>y or x#>>y)

public class PgJsonTraversalExpression : SqlExpression, IRelationalQuotableExpression, IPrintableExpression, IEquatable<PgJsonTraversalExpression>
Inheritance
PgJsonTraversalExpression
Implements
Inherited Members

Constructors

PgJsonTraversalExpression(SqlExpression, IReadOnlyList<SqlExpression>, bool, Type, RelationalTypeMapping?)

public PgJsonTraversalExpression(SqlExpression expression, IReadOnlyList<SqlExpression> path, bool returnsText, Type type, RelationalTypeMapping? typeMapping)

Parameters

expression SqlExpression
path IReadOnlyList<SqlExpression>
returnsText bool
type Type
typeMapping RelationalTypeMapping

Properties

Expression

The match expression.

public virtual SqlExpression Expression { get; }

Property Value

SqlExpression

Path

The pattern to match.

public virtual IReadOnlyList<SqlExpression> Path { get; }

Property Value

IReadOnlyList<SqlExpression>

ReturnsText

Whether the text-returning operator (x#>>y) or the object-returning operator (x#>y) is used.

public virtual bool ReturnsText { get; }

Property Value

bool

Methods

Append(SqlExpression)

Appends an additional path component to this PgJsonTraversalExpression and returns the result.

public virtual PgJsonTraversalExpression Append(SqlExpression pathComponent)

Parameters

pathComponent SqlExpression

Returns

PgJsonTraversalExpression

Equals(PgJsonTraversalExpression?)

Indicates whether the current object is equal to another object of the same type.

public virtual bool Equals(PgJsonTraversalExpression? other)

Parameters

other PgJsonTraversalExpression

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

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 ExpressionPrinter

The 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

Expression

ToString()

Returns a textual representation of the Expression.

public override string ToString()

Returns

string

A textual representation of the Expression.

Update(SqlExpression, IReadOnlyList<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 PgJsonTraversalExpression Update(SqlExpression expression, IReadOnlyList<SqlExpression> path)

Parameters

expression SqlExpression
path IReadOnlyList<SqlExpression>

Returns

PgJsonTraversalExpression

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 ExpressionVisitor

An instance of Func<T, TResult>.

Returns

Expression

The expression being visited, or an expression which should replace it in the tree.