Values stored to ApplicationContext.ClientContext are not available on the server. #2213
Replies: 4 comments 1 reply
-
Update |
Beta Was this translation helpful? Give feedback.
-
The |
Beta Was this translation helpful? Give feedback.
-
I have created a new app state class called
This I have also created my To save the object to the
To retrieve that same object I call:
When I retrieve the saved object when still inside the razor component I get the following returned: This is expected as I have overwritten the If I do the same retrieve call on the Actual result is I don't get the same values instead I just seem to get the Am I missing something here ? |
Beta Was this translation helpful? Give feedback.
-
Also, this thread may have useful info about an issue that's fixed in v5.4.2. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to store UI state in a Blazor Web Assembly component by using
Csla.ApplicationContext.ClientContext
as I've read it passes data from Client to Server.The hope is that the UI state stored in
Csla.ApplicationContext.ClientContext
will be available on the DataPortal API when doing calls to[Create]
[Fetch]
etc methods without the need of passing the UI state values as parameters.I'm not sure what I've outlined above is possible as I've tried to do it but without any success.
Details of what I've tried so far...
I have a class called
AppState
which is in theShared
project so that it is accessible betweenClient
andServer
projects.That class has been added to the
Client
DI inProgram.cs
so its available throughout the Blazor WebAssembly app.I have a
CascadingAppStateProvider
component which wraps the application so that state changes are handled in this component.The
AppState
is being populated correctly in the component and then is being assigned to theCsla.ApplicationContext.ClientContext
When trying to retrieve the same UI state on the server from a DataPortal API method
Csla.ApplicationContext.ClientContext
has an instance ofAppState
but it has all thedefault
values and none of the values set in the Blazor component.Version and Platform
CSLA version: 5.4.2
OS: Windows
Platform: ASP.NET Core, Blazor WebAssembly Hosted
AppState.cs
Beta Was this translation helpful? Give feedback.
All reactions