Skip to content

feature: Lazy ReflectionConverter#57

Merged
IvanMurzak merged 11 commits into
mainfrom
feature/lazy-reflection-converter
Jan 18, 2026
Merged

feature: Lazy ReflectionConverter#57
IvanMurzak merged 11 commits into
mainfrom
feature/lazy-reflection-converter

Conversation

@IvanMurzak
Copy link
Copy Markdown
Owner

@IvanMurzak IvanMurzak commented Jan 18, 2026

This pull request introduces a new LazyReflectionConverter class 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:

  • Introduced the LazyReflectionConverter class in LazyReflectionConverter.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:

  • Added LazyReflectionConverterTests to 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.

…tion priority, ignored properties, constructor validation, and backing converter delegation.
@IvanMurzak IvanMurzak self-assigned this Jan 18, 2026
@IvanMurzak IvanMurzak added the enhancement New feature or request label Jan 18, 2026
@IvanMurzak IvanMurzak requested a review from Copilot January 18, 2026 07:25
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 18, 2026

Test Results

    2 files  ± 0      2 suites  ±0   7m 37s ⏱️ -44s
1 153 tests + 7  1 153 ✅ + 7  0 💤 ±0  0 ❌ ±0 
2 306 runs  +14  2 306 ✅ +14  0 💤 ±0  0 ❌ ±0 

Results for commit 6d2cdb6. ± Comparison against base commit a4551d8.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 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 LazyReflectionConverter class 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.

Comment thread ReflectorNet/src/Converter/Reflection/LazyReflectionConverter.cs
Comment thread ReflectorNet/src/Converter/Reflection/LazyReflectionConverter.cs Outdated
Comment thread ReflectorNet.Tests/src/ReflectorTests/LazyReflectionConverterTests.cs Outdated
Comment thread ReflectorNet.Tests/src/ReflectorTests/LazyReflectionConverterTests.cs Outdated
…ptimize target type resolution using Lazy<T>
…d properties and fields when using a backing converter
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread ReflectorNet.Tests/src/ReflectorTests/LazyReflectionConverterTests.cs Outdated
@IvanMurzak IvanMurzak merged commit ece5295 into main Jan 18, 2026
2 checks passed
@IvanMurzak IvanMurzak deleted the feature/lazy-reflection-converter branch January 18, 2026 08:55
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