Skip to content
IzzyBlazor 0.1.0-alpha.20

Enter all results ↑ ↓ move Esc close

FilterBuilder

Since 0.1.0-alpha.20
Builds a filter of nested groups and rules from fields.

IzzyBlazor.FilterBuilder<TItem> in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.20 assembly and its doc comments.

Properties (7)

FieldsIReadOnlyList<DataField<TItem>> requiredAdded in 0.1.0-alpha.20

The fields to build from: DataFields.Of<Order>(), or your own. Only filterable text, numbers, dates, enums and booleans are offered.

@bind-ValueFilter?Added in 0.1.0-alpha.20 @bind: Interactive only

The filter. Bind it on an interactive page; otherwise it's read from the address.

Namestring = "filter"Added in 0.1.0-alpha.20

The key in the address. Defaults to filter.

PageKeystring = "page"Added in 0.1.0-alpha.20

The address's page number, dropped on Apply, as a new filter starts at the first page. Defaults to page.

CursorKeystring = "cursor"Added in 0.1.0-alpha.20

The address's cursor, dropped on Apply as the page number is. Defaults to cursor.

MaxDepthint = 5Added in 0.1.0-alpha.20

How deeply groups can nest. Defaults to 5.

Labelstring? = "Filter builder"Added in 0.1.0-alpha.20

Its name for screen readers. Defaults to "Filter builder".

Events (0)

No events.

Types (2)

DataField

class

A field of the data: its key in requests and addresses, the expression that reads it, and what can be done with it. One description serves sorting, filtering and search. A Table's columns are fields; Of reads them from a type.

DataField members
MemberDescription
Key string

The field's name in requests and the address, such as "total" or "customer.name".

Value LambdaExpression

What the field reads from an item, such as (Expression<Func<Order, decimal>>)(o => o.Total).

Type Type

The type of the field's value.

Caption string?

The field's name for people: [Display(Name)], else the property name in words.

Format string?

A .NET format string for the value, such as C: [DisplayFormat(DataFormatString)].

Sortable bool = false

Whether a request can sort by it.

Filterable bool = false

Whether a filter can name it. A condition on a field that isn't filterable matches nothing.

Searchable bool = false

Whether a request's Search looks in it (text that contains the search, by its Case).

Groupable bool = false

Whether a DataGroupRequest<T> can group by it.

Aggregatable bool = false

Whether a DataGroupRequest<T> can work out an aggregate on it.

AggregateBy LambdaExpression?

The field's own aggregate (DataAggregate.Custom), an expression over a group's items, so it runs in the database: (Expression<Func<IEnumerable<Order>, decimal>>)(g => g.Sum(o => o.Profit) / g.Sum(o => o.Total)).

Case FilterCase = FilterCase.IgnoreCase

How text compares in a filter or search on it. MatchCase goes first for one condition. A grid's FilterCase comes here through its columns; an endpoint that reads the same filter, such as an export, sets it on its own fields.

Operators IReadOnlyList<FilterOperator>?

The operators it takes, of those its type takes (see FilterOperator); null for all of them.

Choices IReadOnlyList<ValueTuple<string, string>>?

The values to choose from, value and text: an enum's names (with their [Display(Name)]) by default.

Filter Func<FieldFilter, Expression<Func<TItem, bool>>?>?

Builds the condition for this field yourself: for a computed value, full-text search, or a value stored differently from how it's shown. It gets the condition with its values parsed for the field's type (a list for In and NotIn, a DateOnly for a whole day) and returns the filter on the item, or null for the usual one.

FilterValues FilterValuesLoader?

Finds the values a filter on this field can list, for LoadValuesAsync. A column's own FilterValues comes here.

Filter

record

A filter on data: a condition on one field (FieldFilter), conditions joined by and or or (FilterGroup), or the opposite of one (NotFilter). Fields are named by their key (a column's SortKey, or a DataField<T>'s Key). It becomes a LINQ expression on the fields' own properties, so an EF Core query filters in the database; a value never becomes code.

Filter members
MemberDescription
Parse(string text)

Reads a filter written in the subset of OData's $filter that ?filter= takes: total ge 100 and (status in ('Paid','Pending') or customer contains 'ada'). Comparisons (eq ne gt ge lt le), in, and or not, parentheses, contains, startswith and endswith (as functions or between field and value), date(field) eq 2026-01-31 for a day, and null. Text matches ignoring case, as a Table's filters do (OData's own contains matches case).

Find(string field)

The condition on field that every match must meet: this filter itself, or one inside its and groups (not inside an or group or a not). Null when there's none. For a provider that passes conditions on to an API: request.Filter?.Find("who")?.Value.

Connection lost

Rejoining the server…