RazorDocs Search

ViewComponents

Type

UserListViewComponent

A view component that renders a list of active users, optionally recording the current user's activity.

Method

Invoke

IViewComponentResult Invoke(IEnumerable<UserPresenceInfo>? users = null)

Renders a view displaying the current active users.

Parameters

  • usersAn optional collection of user presence entries to display; if null, active users are retrieved from the presence service.

Returns

A view result whose model is a List<UserPresenceInfo> representing the active users.

Remarks

If a non-empty "razorwire-username" cookie is present on the request, the user's activity is recorded via the presence service before rendering.

Type

CounterViewComponent

A view component that manages and displays a global synchronized counter.

Method

Increment

void Increment()

Atomically increments the component's shared counter by one in a thread-safe manner.

Method

Invoke

IViewComponentResult Invoke()

Renders the view for this component using the current counter value as the model.

Returns

A view component result whose model is the current counter value.

Property

Count

int Count { get; }

Gets the current value of the global counter.