Class QueryState

Assembly: redb.Tsak.Web.dll

A page's meaningful state (time range, filters, sub-tab) kept in the address query, so that it survives a reload,
a shared link and a change of node through the switcher (which keeps the query). The address is replaced, not
pushed: changing a filter does not add a step to the browser history.

public static class QueryState

Inheritance

Object→QueryState

Methods

OneOf(string?, IReadOnlyList<int>, int)

One of allowed parsed from value, else fallback.

public static int OneOf(string? value, IReadOnlyList<int> allowed, int fallback)

OneOf(string?, IReadOnlyList<string>, string)

One of allowed (any case, returned as listed), else fallback.

public static string OneOf(string? value, IReadOnlyList<string> allowed, string fallback)

Set(NavigationManager, IReadOnlyDictionary<string, string?>)

Writes several parameters at once (one address change); empty values remove theirs.

public static void Set(NavigationManager nav, IReadOnlyDictionary<string, string?> values)

Set(NavigationManager, string, string?, string?)

Writes value under name; an empty value or the default removes the parameter.

public static void Set(NavigationManager nav, string name, string? value, string? defaultValue = null)