Table of Contents

Class ComparisonExpression

Namespace
JsonApiDotNetCore.Queries.Expressions
Assembly
JsonApiDotNetCore.dll

This expression allows to compare two operands using a comparison operator. It represents comparison filter functions, resulting from text such as: equals(name,'Joe') , equals(owner,null) , or: greaterOrEqual(count(upVotes),count(downVotes),'1') .

[PublicAPI]
public class ComparisonExpression : FilterExpression
Inheritance
ComparisonExpression
Inherited Members

Constructors

ComparisonExpression(ComparisonOperator, QueryExpression, QueryExpression)

public ComparisonExpression(ComparisonOperator @operator, QueryExpression left, QueryExpression right)

Parameters

operator ComparisonOperator
left QueryExpression
right QueryExpression

Properties

Left

The left-hand operand, which can be a function or a field chain. Chain format: an optional list of to-one relationships, followed by an attribute. When comparing equality with null, the chain may also end in a to-one relationship.

public QueryExpression Left { get; }

Property Value

QueryExpression

Operator

The operator used to compare Left and Right.

public ComparisonOperator Operator { get; }

Property Value

ComparisonOperator

Right

The right-hand operand, which can be a function, a field chain, a constant, or null (if the type of Left is nullable). Chain format: an optional list of to-one relationships, followed by an attribute.

public QueryExpression Right { get; }

Property Value

QueryExpression

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.