RunicFilter class

Namespace Runic.Application.Views in Runic.Application.Views 0.23.0

public sealed class RunicFilter

One filter of a RunicQuery. Values are JSON, as the page sends them.

Properties

Field

public string Field { get; }

The field the filter applies to, or the name of a RunicFilterOperator.Custom filter.

Maximum

public JsonElement Maximum { get; }

The inclusive upper bound of a range, or JsonValueKind.Undefined for none.

Minimum

public JsonElement Minimum { get; }

The inclusive lower bound of a range, or JsonValueKind.Undefined for none.

Operator

public RunicFilterOperator Operator { get; }

What the filter compares.

Value

public JsonElement Value { get; }

Methods

Contains

public static RunicFilter Contains(string field, string text)

A filter that keeps rows whose text field contains text.

Parameters

field

The field.

text

The text to find.

Custom

public static RunicFilter Custom(string name, JsonElement value = default)

A filter that the row source defines, such as "rows I own" or a full-text search.

Parameters

name

The filter's name.

value

Its JSON argument, or a default JsonElement for none.

Equal

public static RunicFilter Equal(string field, JsonElement value)

A filter that keeps rows whose field equals value.

Parameters

field

The field.

value

The JSON value, encoded as the field's wire type.

Equal

public static RunicFilter Equal(string field, string? value)

A filter that keeps rows whose field equals the string value.

Parameters

field

The field.

value

The string.

Equal

public static RunicFilter Equal(string field, double value)

A filter that keeps rows whose field equals the number value.

Parameters

field

The field.

value

The number.

Equal

public static RunicFilter Equal(string field, bool value)

A filter that keeps rows whose field equals the Boolean value.

Parameters

field

The field.

value

The Boolean.

Range

public static RunicFilter Range(string field, JsonElement minimum, JsonElement maximum)

A filter that keeps rows whose field lies between two inclusive JSON bounds.

Parameters

field

The field.

minimum

The lower bound, or a default JsonElement for none.

maximum

The upper bound, or a default JsonElement for none.

Range

public static RunicFilter Range(string field, double? minimum, double? maximum)

A filter that keeps rows whose numeric field lies between two inclusive bounds.

Parameters

field

The field.

minimum

The lower bound, or null for none.

maximum

The upper bound, or null for none.