Simplify IParamConverterManager to single two-parameter GetConverter method#94
Merged
Simplify IParamConverterManager to single two-parameter GetConverter method#94
Conversation
Co-authored-by: twogood <189982+twogood@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add back support for ParameterInfo in IParamConverter
Add back support for ParameterInfo in IParamConverter
Aug 6, 2025
twogood
reviewed
Aug 6, 2025
Co-authored-by: twogood <189982+twogood@users.noreply.github.com>
Copilot
AI
changed the title
Add back support for ParameterInfo in IParamConverter
Update IParamConverter to require non-nullable ParameterInfo
Aug 6, 2025
Owner
|
@copilot remove the existing GetConverter(Type type) and GetConverter(ParameterInfo parameterInfo) and only have the new method with two parameters. |
Co-authored-by: twogood <189982+twogood@users.noreply.github.com>
Contributor
Author
Removed the single-parameter |
Copilot
AI
changed the title
Update IParamConverter to require non-nullable ParameterInfo
Simplify IParamConverterManager to single two-parameter GetConverter method
Aug 6, 2025
twogood
approved these changes
Aug 6, 2025
twogood
approved these changes
Aug 8, 2025
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 PR simplifies the
IParamConverterManagerinterface by removing the single-parameterGetConverteroverloads and keeping only the two-parameter method that requires bothTypeandParameterInfo.Background
Following feedback on the previous implementation, the interface has been streamlined to eliminate confusion and ensure consistency. The
IParamConverter.CanConvertmethod now requires both parameters (non-nullable), so having single-parameter overloads in the manager was creating unnecessary complexity.Changes
The
IParamConverterManagerinterface has been simplified from:to:
Key Improvements
GetConvertermethod that requires both type and parameter informationSyntheticParameterInfoclass that was only used for backward compatibilityUpdated Usage
All code that previously used single-parameter overloads has been updated:
This change ensures that parameter converters always have access to complete context information while maintaining a clean, simple API.
Fixes #93.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.