Skip to content

Criteria class

namespace: Serenity.Data   assembly: Serenity.Net.Services

An object that is used to create criteria by employing the operator overloading features of the C# language, instead of using string based criteria.

public class Criteria : BaseCriteria

Public Members

name description
Criteria(…) Creates a new criteria with the given condition. This condition is usually a field name, but it can also be a pre-generated criteria text. (10 constructors)
static Bracket(…) Creates a new criteria containing the field name in brackets.
Expression { get; } Gets the criteria expression.
Field { get; } Gets a reference to the IField object passed to the constructor.
override IsEmpty { get; } Gets whether the criteria is empty.
override ToString(…) Converts the criteria to its string representation while adding its parameters to the target query.
static readonly Empty An empty criteria instance.
static readonly False The false criteria instance (0 = 1).
static readonly True The true criteria instance (1 = 1).
static EscapeLikeWildcards(…) Escapes a literal value for use in a LIKE pattern with the given escape character. The escape character itself is escaped first, then %, _ and [. A ] outside a [...] class is literal on all supported dialects, so it is left as is. The result must be used with ESCAPE 'x' declared (see LikeEscapeChar), otherwise the escape character matches itself instead of escaping.
static Exists(…) Creates a new EXISTS criteria. (3 methods)

See Also