Table of Contents

Class LogicalExpression

Namespace
JsonApiDotNetCore.Queries.Expressions
Assembly
JsonApiDotNetCore.dll

This expression allows to test whether one or all of its boolean operands are true. It represents the logical AND/OR filter functions, resulting from text such as: and(equals(title,'Work'),has(articles)) , or: or(equals(title,'Work'),has(articles)) .

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

Constructors

LogicalExpression(LogicalOperator, params FilterExpression[])

public LogicalExpression(LogicalOperator @operator, params FilterExpression[] terms)

Parameters

operator LogicalOperator
terms FilterExpression[]

LogicalExpression(LogicalOperator, IImmutableList<FilterExpression>)

public LogicalExpression(LogicalOperator @operator, IImmutableList<FilterExpression> terms)

Parameters

operator LogicalOperator
terms IImmutableList<FilterExpression>

Properties

Operator

The operator used to compare Terms.

public LogicalOperator Operator { get; }

Property Value

LogicalOperator

Terms

The list of one or more boolean operands.

public IImmutableList<FilterExpression> Terms { get; }

Property Value

IImmutableList<FilterExpression>

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

Compose(LogicalOperator, params FilterExpression?[])

public static FilterExpression? Compose(LogicalOperator @operator, params FilterExpression?[] filters)

Parameters

operator LogicalOperator
filters FilterExpression[]

Returns

FilterExpression

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.