Files
EchoHub/docs/auriondocs/Code/src/EchoHub.Client/Services/UserSession.cs.md
T
Hue f8f4e03ddd docs: Update documentation for 145 files
Generated by AurionDocs
Job ID: c99fff50-67a3-4294-b4df-3e73f4f12de9
Source commit: 4dcb480
2026-07-23 08:10:35 +02:00

1.0 KiB

UserSession

File: src/EchoHub.Client/Services/UserSession.cs
Kind: class

internal sealed class UserSession

Stores the current user's session state on the client, including username, online status, and an optional status message. Use this type as a lightweight, centralized container when you need to read or mutate the ephemeral session data for the active user, and call Reset to return all fields to their defaults (empty username, Online status, and no status message).

Remarks

Internally sealed and non-public, this class keeps the session representation stable within the client service layer and prevents inheritance. It relies on the UserStatus enum from the core models to express the user's current state consistently across the application.

Notes

  • Not thread-safe by default; coordinate concurrent access if used from multiple threads.
  • Reset mutates state in place; if you require preserving data, capture it before calling Reset.
  • StatusMessage is nullable; null indicates that no message is provided.