Class JsonQueryExpression
- Namespace
- Microsoft.EntityFrameworkCore.Query
- Assembly
- Microsoft.EntityFrameworkCore.Relational.dll
An expression representing an entity or a collection of entities mapped to a JSON column and the path to access it.
This type is typically used by database providers (and other extensions). It is generally not used in application code.
public class JsonQueryExpression : Expression, IPrintableExpression
- Inheritance
-
JsonQueryExpression
- Implements
-
IPrintableExpression
- Inherited Members
Constructors
JsonQueryExpression(IEntityType, ColumnExpression, IReadOnlyDictionary<IProperty, ColumnExpression>, Type, bool)
Creates a new instance of the JsonQueryExpression class.
public JsonQueryExpression(IEntityType entityType, ColumnExpression jsonColumn, IReadOnlyDictionary<IProperty, ColumnExpression> keyPropertyMap, Type type, bool collection)
Parameters
entityType
IEntityTypeAn entity type being represented by this expression.
jsonColumn
ColumnExpressionA column containing JSON value.
keyPropertyMap
IReadOnlyDictionary<IProperty, ColumnExpression>A map of key properties and columns they map to in the database.
type
TypeA type of the element represented by this expression.
collection
boolA value indicating whether this expression represents a collection or not.
Properties
EntityType
The entity type being represented by this expression.
public virtual IEntityType EntityType { get; }
Property Value
- IEntityType
IsCollection
The value indicating whether this expression represents a collection.
public virtual bool IsCollection { get; }
Property Value
IsNullable
The value indicating whether this expression is nullable.
public virtual bool IsNullable { get; }
Property Value
JsonColumn
The column containg JSON value.
public virtual ColumnExpression JsonColumn { get; }
Property Value
NodeType
public override ExpressionType NodeType { get; }
Property Value
Path
The list of path segments leading to the entity from the root of the JSON stored in the column.
public virtual IReadOnlyList<PathSegment> Path { get; }
Property Value
Type
public override Type Type { get; }
Property Value
Methods
BindNavigation(INavigation)
Binds a navigation with this JSON query expression to get the SQL representation.
public virtual JsonQueryExpression BindNavigation(INavigation navigation)
Parameters
navigation
INavigationThe navigation to bind.
Returns
- JsonQueryExpression
An JSON query expression for the target entity type of the navigation.
BindProperty(IProperty)
Binds a property with this JSON query expression to get the SQL representation.
public virtual SqlExpression BindProperty(IProperty property)
Parameters
property
IProperty
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
MakeNullable()
Makes this JSON query expression nullable.
public virtual JsonQueryExpression MakeNullable()
Returns
- JsonQueryExpression
A new expression which has IsNullable property set to true.
Print(ExpressionPrinter)
public virtual void Print(ExpressionPrinter expressionPrinter)
Parameters
expressionPrinter
ExpressionPrinter
Update(ColumnExpression, IReadOnlyDictionary<IProperty, ColumnExpression>)
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 JsonQueryExpression Update(ColumnExpression jsonColumn, IReadOnlyDictionary<IProperty, ColumnExpression> keyPropertyMap)
Parameters
jsonColumn
ColumnExpressionThe JsonColumn property of the result.
keyPropertyMap
IReadOnlyDictionary<IProperty, ColumnExpression>The map of key properties and columns they map to.
Returns
- JsonQueryExpression
This expression if no children changed, or an expression with the updated children.
VisitChildren(ExpressionVisitor)
protected override Expression VisitChildren(ExpressionVisitor visitor)
Parameters
visitor
ExpressionVisitor