RunicViewState<TModel> class

Namespace Runic.Application.Testing · Runic.Application.Testing 0.7.0-preview.5

public sealed class RunicViewState<TModel> where TModel : class

A generated wire state of a TModel route, read by ViewModel member.

Properties

this[]

public JsonElement this[string field] { get; }

A wire field by name.

Json

public JsonElement Json { get; }

The wire state, including revision.

Revision

public long Revision { get; }

The revision of the state.

Methods

CanExecute

public bool CanExecute(Expression<Func<TModel, object?>> command)

Whether an argument-free command is available (can{Command}).

FieldVersion

public long FieldVersion<TValue>(Expression<Func<TModel, TValue>> property)

The version of a checked field, which a checked write must name as its baseline.

Get

public JsonElement Get<TValue>(Expression<Func<TModel, TValue>> property)

The wire value of a state property.

IsExecuting

public bool IsExecuting(Expression<Func<TModel, object?>> command)

Whether an asynchronous command is running (is{Command}Executing).

Keys

public IReadOnlyList<string> Keys(Expression<Func<TModel, object?>> collection)

The row keys of a RunicCollectionAttribute collection, in order.

Read

public TValue Read<TValue>(Expression<Func<TModel, TValue>> property)

Reads a scalar state property: a string, Boolean, Int32, Int64, double, decimal, GUID or enum. Use RunicViewState.Get for other values.

Reference

public PageReference? Reference(Expression<Func<TModel, object?>> property)

The content reference a ViewModel content property presents, or null.

References

public IReadOnlyList<PageReference> References(Expression<Func<TModel, object?>> property)

The content references a ViewModel collection presents.

ToString

public override string ToString()

Inherits documentation from Object.ToString.