feature: Lazy ReflectionConverter#57
Merged
Merged
Conversation
…urable property ignoring.
…optional delegation during serialization.
…tion priority, ignored properties, constructor validation, and backing converter delegation.
Contributor
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request introduces a LazyReflectionConverter class that enables runtime type resolution by name, supporting optional dependencies where types may not always be present. The converter includes features for property/field filtering and optional delegation to a backing converter.
Changes:
- Added
LazyReflectionConverterclass with lazy type resolution, property/field ignoring, and backing converter delegation - Added comprehensive unit tests covering type resolution, property filtering, constructor validation, and backing converter behavior
- Implemented serialization priority calculation based on type matching and inheritance distance
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| ReflectorNet/src/Converter/Reflection/LazyReflectionConverter.cs | New converter implementation with lazy type resolution and configurable serialization behavior |
| ReflectorNet.Tests/src/ReflectorTests/LazyReflectionConverterTests.cs | Comprehensive test suite for the new converter covering various scenarios and edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ptimize target type resolution using Lazy<T>
…d properties and fields when using a backing converter
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ests for exact and derived types
…n ignored properties and fields when using a backing converter" This reverts commit a287a3a.
…on for optional dependencies.
…al serialization delegation.
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 introduces a new
LazyReflectionConverterclass to the codebase, providing a flexible way to handle serialization for types that may not always be present at runtime. Comprehensive unit tests for this converter are also added, ensuring correct behavior in different scenarios such as type existence, property ignoring, and delegation to a backing converter.Key Additions:
New Converter Implementation:
LazyReflectionConverterclass inLazyReflectionConverter.cs, which resolves its target type by name at runtime, supports ignoring specific properties and fields, and can delegate serialization to a backing converter if provided. This enables optional dependencies and more flexible serialization strategies.Testing:
LazyReflectionConverterTeststo verify behavior for type resolution, property ignoring, backing converter delegation, and error handling for invalid type names. These tests ensure the converter works as intended and is robust against edge cases.