Old PR redux: helpers for common .Serialization.cs patterns, header cleanup #113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a contemporary followup to the earlier one -- better now that we're fully aligned with a codegen base:
#48
The helper still brings some utility in centralizing logic and eliminating duplication in the custom layer.
It also opportunistically fixes a lot of ugly copy/paste header errors in the Assistants folder.
To rehash the helper PR (longer description there):
internal static Foo DeserializeFoo(JsonElement, ModelReaderWriterOptions)
(as before)internal static void SerializeFoo(Foo, Utf8JsonWriter, options)
IJsonModel<Foo>
implementations can then just defer to theCustomSerializationHelpers
methods, allowing everything but the serialize/deserialize methods to be one trivial line