Proper way to do per user state management in Blazor with Identity
Hi. I am attempting to have state management with blazor & identity. So basically I want to acquire the current user in the ManageLayout and then reuse the data in navmenu or in @body. I was thinking of just passing them as parameters, but you need some kind of synchronization due to asynchronous user retrieval. this is my state code :
Currently this doesn't work in another component, when
Username
is initialized it doesn't really notify all components even though the state is injected, I assume that's due to service being Scoped
. How is the conventional way to approach this issue?
ManageLayout.razor :
Index.razor
1 Reply
even with this I get cannot call method of a disposed class. but IdentityUserAccessor is scoped.. im confused