Multi profile support #167
Marvin-Brouwer
started this conversation in
Polls
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So we'd like to support multiple profiles for when you have one POCO but multiple API endpoint that may need different fields or even just a different naming convention.
The difficult part is how to design that, Currently we have 3 proposals:
Keep in mind that these are just suggestions and not the final approach, this is just to illustrate the general approach but the eventual code may change.
1: Overloads
Having an overload for each method where you can provide a profile when serializing.
Pros:
Cons:
2: Factory approach
Having a named factory in the DI setup where you can reference the applicable profiles.
Pros:
Cons
3: Fluent approach
Adding a property to the serializer to return a new instance of the serializer that only supports that given profile.
Pros:
Cons
However, perhaps this is doable with a wrapper that overloads a
Func<>
which is responsible for looking up the profiles?0 votes ·
Beta Was this translation helpful? Give feedback.
All reactions