-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsquestion
Description
Once I have it working, I would like to check how much setup I would need to create and register a general serializer that would work for any type or a subset of types.
My key concerns would be that:
- It might not be possible to register a single generic serializer for any type, so you will have to register serializers for all types manually.
- If it is possible to register a serializer for any generic type, it might not be possible to constrain this to only work for a subset of types. Imagine that I add a serializer that builds on MessagePack, but that this can only serialize types that are annotated with the
[MessagePackObject]
attribute, then I would not be able to say that it should fall back to JSON for types that are not annotated correctly. Preferebly it would be nice to have some way to add custom logic for whether a generic serializer could serialize a specificType
like in theChain-of-responsibility pattern
.But since I haven't gotten the minimal sample to work yet, I have not been able to see what was needed for the above use cases.
Originally posted by @KristofferStrube in #62589
Metadata
Metadata
Assignees
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsquestion