Fix issue where IReadOnlyList<T> wasn't a valid binding type.#2174
Merged
jviau merged 4 commits intoAzure:mainfrom Jan 9, 2024
Merged
Fix issue where IReadOnlyList<T> wasn't a valid binding type.#2174jviau merged 4 commits intoAzure:mainfrom
jviau merged 4 commits intoAzure:mainfrom
Conversation
added 2 commits
December 29, 2023 15:04
…he valid types or if any of the types available on the input type is one of the valid types.
Contributor
Author
|
@microsoft-github-policy-service agree |
jviau
requested changes
Jan 4, 2024
… List type instead of checking the inheritance hierarchy.
jviau
reviewed
Jan 5, 2024
jviau
approved these changes
Jan 9, 2024
Contributor
|
Thank you for the contribution! |
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.
Issue describing the changes in this PR
resolves #2173
Pull request checklist
Otherwise: Documentation issue linked to PROtherwise: I've added my notes torelease_notes.mdOtherwise: Backport tracked by issue/PR #issue_or_prAdditional information
I leveraged Linq to give what I felt was a "cleaner" approach where the IsListInterface can succinctly look at the value of the Type as well as the value of all of the Interfaces of the type to see if it's valid. I think this should cover every situation where the passed in interface type inherits from one of the valid types.
I know this isn't an optimal runtime solution since LINQ can be slower but since we're talking reflection I figured it was a good tradeoff. If there are performance issues with this approach I'd love to learn more.