Open
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
No response
Describe the solution you'd like
PersistentComponentState's TryTakeFromJson method uses System.Text.Json's auto generated sources of JsonSerializerContext & JsonSerializable
I'd like to use something like what asp.net core web API has as followings:
services
.AddControllers...
.AddJsonOptions(options => options.JsonSerializerOptions.AddContext<MyAppJsonContext>());
So aspnet core web API uses MyAppJsonContext globally to improve its performance.
I'd like to use generated sources of System.Text.Json in client side to read transferred json state
Currently blazor uses JsonSerializerOptionsProvider which is internal and we can't call .AddContext() to make sure it has access to our source generator based context
Additional context
No response