Replies: 1 comment
-
CSLA objects can't be serialized into and out of JSON directly. You need to convert them into a byte array or string by using MobileFormatter, and then put that value into the persistent component state API. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to get the PersistentComponentState service working in my Blazor Web App. I have a ReadOnlyList that is loaded into my vm.Model in the OnInitializedAsync method. I am trying to persist it so that when the component is re-rendered when web assembly is available, it will not have to reload the model from the server. The problem is that when I call ApplicationState.PersistAsJson I get an error that my type is abstract, an interface, or is read only, and could not be instantiated and populated. The error makes sense as this is a ReadOnlyList. I was wondering if anyone knows a simple, relatively painless work around for this.
Beta Was this translation helpful? Give feedback.
All reactions