feat: enhance IReflectionConverter interface with cascading conversion properties#59
Merged
IvanMurzak merged 3 commits intoJan 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request refactors the reflection converter implementation by renaming LazyReflectionConverter to LazyGenericReflectionConverter and introducing both generic and non-generic variants. It also extends the IReflectionConverter interface with four new properties that provide fine-grained control over serialization behavior: AllowSetValue, AllowCascadeSerialization, AllowCascadeFieldsConversion, and AllowCascadePropertiesConversion.
Changes:
- Introduced
LazyGenericReflectionConverter<T>(generic) andLazyGenericReflectionConverter(non-generic) to replace the previousLazyReflectionConverter - Extended
IReflectionConverterinterface with four new properties for controlling value assignment and cascading serialization behavior - Updated all test references from
LazyReflectionConvertertoLazyGenericReflectionConverter
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ReflectorNet/src/Converter/Reflection/LazyGenericReflectionConverter.cs | Introduced generic and non-generic versions of the converter with property overrides that delegate to backing converters |
| ReflectorNet/src/Converter/IReflectionConverter.cs | Added four new properties with comprehensive XML documentation for controlling serialization behavior |
| ReflectorNet.Tests/src/ReflectorTests/LazyReflectionConverterTests.cs | Updated all test instantiations and assertions to use the new class name |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 pull request refactors the reflection converter implementation to introduce a more generic and extensible approach for lazy type resolution, and updates the interface to provide finer control over serialization behavior. The main changes include replacing
LazyReflectionConverterwithLazyGenericReflectionConverter, updating all references and tests accordingly, and expanding theIReflectionConverterinterface with new properties for controlling serialization and conversion strategies.Reflection Converter Refactoring
LazyGenericReflectionConverter<T>and a non-genericLazyGenericReflectionConverterfor flexible lazy type resolution, replacing the previousLazyReflectionConverterimplementation. The new converters allow specifying ignored properties/fields and an optional backing converter, and override new interface properties to delegate to the backing converter when available. (ReflectorNet/src/Converter/Reflection/LazyGenericReflectionConverter.cs, previouslyLazyReflectionConverter.cs)LazyGenericReflectionConverterinstead ofLazyReflectionConverter, ensuring test coverage remains consistent with the new implementation. (ReflectorNet.Tests/src/ReflectorTests/LazyReflectionConverterTests.cs) [1] [2] [3] [4] [5] [6] [7] [8] [9]Interface Enhancements
IReflectionConverterinterface to include new properties:AllowSetValue,AllowCascadeSerialization,AllowCascadeFieldsConversion, andAllowCascadePropertiesConversion, each with detailed XML documentation. These additions give consumers more granular control over how converters handle value assignment and recursive serialization of fields and properties. (ReflectorNet/src/Converter/IReflectionConverter.cs)