Table of Contents

Class Operator

Namespace
Breeze.Core
Assembly
Breeze.Core.dll

An operator that may appear in a query - a comparison, a boolean connective, or a collection quantifier - identified by the name a client sends for it.

public class Operator
Inheritance
Operator
Derived
Inherited Members

Remarks

Every operator is a singleton declared as one of the static fields below, and constructing one registers it so that FromString(string) can find it. The names are part of the wire format and cannot be changed without breaking clients.

Constructors

Operator(string, OperatorType)

Create an operator and register it for lookup by FromString(string).

public Operator(string aliases, OperatorType opType)

Parameters

aliases string

Comma-separated names for the operator; the first becomes its Name.

opType OperatorType

Which kind of predicate the operator builds.

Fields

All

True when every item of a collection satisfies the inner predicate.

public static Operator All

Field Value

Operator

And

Boolean conjunction of two or more predicates.

public static Operator And

Field Value

Operator

Any

True when at least one item of a collection satisfies the inner predicate.

public static Operator Any

Field Value

Operator

Contains

Substring test, compiled to Contains(string).

public static BinaryOperator Contains

Field Value

BinaryOperator

EndsWith

String suffix test, compiled to EndsWith(string).

public static BinaryOperator EndsWith

Field Value

BinaryOperator

Equals

Equality. Declared new because it hides the inherited Equals(object).

public static BinaryOperator Equals

Field Value

BinaryOperator

GreaterThan

Ordered comparison, strictly greater than.

public static BinaryOperator GreaterThan

Field Value

BinaryOperator

GreaterThanOrEqual

Ordered comparison, greater than or equal.

public static BinaryOperator GreaterThanOrEqual

Field Value

BinaryOperator

In

Set membership. Its right-hand argument must be an array, and compiles to List<T>.Contains.

public static BinaryOperator In

Field Value

BinaryOperator

LessThan

Ordered comparison, strictly less than.

public static BinaryOperator LessThan

Field Value

BinaryOperator

LessThanOrEqual

Ordered comparison, less than or equal.

public static BinaryOperator LessThanOrEqual

Field Value

BinaryOperator

Not

Boolean negation of a single predicate.

public static Operator Not

Field Value

Operator

NotEquals

Inequality.

public static BinaryOperator NotEquals

Field Value

BinaryOperator

Or

Boolean disjunction of two or more predicates.

public static Operator Or

Field Value

Operator

StartsWith

String prefix test, compiled to StartsWith(string).

public static BinaryOperator StartsWith

Field Value

BinaryOperator

_aliases

The names this operator was declared with; the first of them is its Name.

public List<string> _aliases

Field Value

List<string>

_opMap

Every registered operator, keyed by its lower-cased Name. Prefer FromString(string) over reaching into this.

public static Dictionary<string, Operator> _opMap

Field Value

Dictionary<string, Operator>

Properties

Name

The operator's primary name - the first of the aliases it was declared with, e.g. "eq".

public string Name { get; }

Property Value

string

OpType

Which kind of predicate this operator builds, and so how its operands are read.

public OperatorType OpType { get; }

Property Value

OperatorType

Methods

FromString(string)

Look up an operator by the name a client sent. Matching is case-insensitive and is done on Name.

public static Operator? FromString(string op)

Parameters

op string

The operator name, e.g. "eq" or "startswith".

Returns

Operator

The operator, or null if no operator is registered under that name.