Table of Contents

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

targetToOneRelationship ResourceFieldChainExpression
derivedType ResourceType
child FilterExpression

Properties

Child

An optional filter that the derived resource must match.

public FilterExpression? Child { get; }

Property Value

FilterExpression

DerivedType

The derived resource type to upcast to.

public ResourceType DerivedType { get; }

Property Value

ResourceType

TargetToOneRelationship

An optional to-one relationship to start from. Chain format: one or more to-one relationships.

public ResourceFieldChainExpression? TargetToOneRelationship { get; }

Property Value

ResourceFieldChainExpression

Methods

Accept<TArgument, TResult>(QueryExpressionVisitor<TArgument, TResult>, TArgument)

public override TResult Accept<TArgument, TResult>(QueryExpressionVisitor<TArgument, TResult> visitor, TArgument argument)

Parameters

visitor QueryExpressionVisitor<TArgument, TResult>
argument TArgument

Returns

TResult

Type Parameters

TArgument
TResult

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.

ToFullString()

public override string ToFullString()

Returns

string

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.