HubPageContextStore class
The HubPageContextStore class of Novior.MentorAgent.Server.Hubs: Singleton store that persists the last PageContextSnapshot per SignalR connection ID across…
On this page
Singleton store that persists the last PageContextSnapshot per SignalR connection ID across DI scope boundaries. SignalR creates a new DI scope for every hub method invocation, so the Scoped IMentorPageContext resolved in UpdatePageContext is a different instance from the one resolved in SendMessage. This store bridges the gap: UpdatePageContext writes here; SendMessage reads and applies before the orchestrator runs.
Definition
Section titled “Definition”Namespace: Novior.MentorAgent.Server.Hubs. Package: Novior.MentorAgent.Server.
public sealed class HubPageContextStore
dotnet add package Novior.MentorAgent.ServerConstructors
Section titled “Constructors”public HubPageContextStore()
Methods
Section titled “Methods”public PageContextSnapshot? Get(string connectionId)
Remove
Section titled “Remove”public void Remove(string connectionId)
public void Store(string connectionId, PageContextSnapshot snapshot)
