Skip to content

feat: enhance IReflectionConverter interface with cascading conversion properties#59

Merged
IvanMurzak merged 3 commits into
mainfrom
update/reflection-converter-interface-properties
Jan 18, 2026
Merged

feat: enhance IReflectionConverter interface with cascading conversion properties#59
IvanMurzak merged 3 commits into
mainfrom
update/reflection-converter-interface-properties

Conversation

@IvanMurzak

@IvanMurzak IvanMurzak commented Jan 18, 2026

Copy link
Copy Markdown
Owner

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 LazyReflectionConverter with LazyGenericReflectionConverter, updating all references and tests accordingly, and expanding the IReflectionConverter interface with new properties for controlling serialization and conversion strategies.

Reflection Converter Refactoring

  • Introduced LazyGenericReflectionConverter<T> and a non-generic LazyGenericReflectionConverter for flexible lazy type resolution, replacing the previous LazyReflectionConverter implementation. 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, previously LazyReflectionConverter.cs)
  • Updated all usages in unit tests to use LazyGenericReflectionConverter instead of LazyReflectionConverter, 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

  • Extended the IReflectionConverter interface to include new properties: AllowSetValue, AllowCascadeSerialization, AllowCascadeFieldsConversion, and AllowCascadePropertiesConversion, 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)

@IvanMurzak IvanMurzak self-assigned this Jan 18, 2026
@IvanMurzak IvanMurzak added the enhancement New feature or request label Jan 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and LazyGenericReflectionConverter (non-generic) to replace the previous LazyReflectionConverter
  • Extended IReflectionConverter interface with four new properties for controlling value assignment and cascading serialization behavior
  • Updated all test references from LazyReflectionConverter to LazyGenericReflectionConverter

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.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    2 files  ±0      2 suites  ±0   8m 42s ⏱️ +29s
1 155 tests ±0  1 155 ✅ ±0  0 💤 ±0  0 ❌ ±0 
2 310 runs  ±0  2 310 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 19010bc. ± Comparison against base commit 14bb137.

@IvanMurzak IvanMurzak merged commit 6190c3a into main Jan 18, 2026
1 check passed
@IvanMurzak IvanMurzak deleted the update/reflection-converter-interface-properties branch January 18, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants