Class IsTypeExpression
- Namespace
- JsonApiDotNetCore.Queries.Expressions
- Assembly
- JsonApiDotNetCore.dll
This expression allows to test if a resource in an inheritance hierarchy can be upcast to a derived type, optionally with a condition where the
derived type is accessible. It represents the "isType" filter function, resulting from text such as:
isType(,men)
,
isType(creator,men)
, or:
isType(creator,men,equals(hasBeard,'true'))
.
[PublicAPI]
public class IsTypeExpression : FilterExpression
- Inheritance
-
IsTypeExpression
- Inherited Members
Constructors
IsTypeExpression(ResourceFieldChainExpression?, ResourceType, FilterExpression?)
public IsTypeExpression(ResourceFieldChainExpression? targetToOneRelationship, ResourceType derivedType, FilterExpression? child)
Parameters
targetToOneRelationshipResourceFieldChainExpressionderivedTypeResourceTypechildFilterExpression
Properties
Child
An optional filter that the derived resource must match.
public FilterExpression? Child { get; }
Property Value
DerivedType
The derived resource type to upcast to.
public ResourceType DerivedType { get; }
Property Value
TargetToOneRelationship
An optional to-one relationship to start from. Chain format: one or more to-one relationships.
public ResourceFieldChainExpression? TargetToOneRelationship { get; }
Property Value
Methods
Accept<TArgument, TResult>(QueryExpressionVisitor<TArgument, TResult>, TArgument)
public override TResult Accept<TArgument, TResult>(QueryExpressionVisitor<TArgument, TResult> visitor, TArgument argument)
Parameters
visitorQueryExpressionVisitor<TArgument, TResult>argumentTArgument
Returns
- TResult
Type Parameters
TArgumentTResult
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.
ToFullString()
public override string ToFullString()
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.