Simplify ComponentFactory property injection and add subtype validation tests#64750
Merged
javiercn merged 2 commits intojaviercn/component-property-injectionfrom Dec 12, 2025
Merged
Conversation
Contributor
|
Greetings! You've submitted a PR that modifies code that is shared with https://github.com/dotnet/runtime . Please make sure you synchronize this code with the changes in that repo! |
…ction tests Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] WIP address feedback on IComponentPropertyActivator for simplification
Simplify ComponentFactory property injection and add subtype validation tests
Dec 12, 2025
d33dcd0
into
javiercn/component-property-injection
17 of 25 checks passed
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.
Simplify ComponentFactory property injection and add subtype validation tests
Remove redundant conditional and validate subtype property injection
Description
Addresses feedback from #64595 to simplify property injection logic and ensure correctness when component activators return subtypes.
Code simplification
ComponentFactory.InstantiateComponentthat had identical behavior in both branchesTest coverage
InstantiateComponent_WhenActivatorReturnsSubtype_InjectsAllSubtypeProperties- validates base and derived type properties are injected when activator returns a subtypeInstantiateComponent_WhenActivatorReturnsExactType_InjectsPropertiesIdenticallyToSubtype- confirms behavior is identical regardless of type matching[Inject]attributeAll 22 tests pass.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.