feat: Resolve additional CustomHandler type arguments from matching type#39
Merged
Dreamescaper merged 2 commits intomainfrom Jul 25, 2025
Merged
feat: Resolve additional CustomHandler type arguments from matching type#39Dreamescaper merged 2 commits intomainfrom
Dreamescaper merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for resolving additional type arguments for CustomHandler methods when they have multiple generic type parameters. The enhancement allows CustomHandler methods to automatically receive type arguments from the matched AssignableTo type, enabling more sophisticated scenarios like Entity Framework's IEntityTypeConfiguration pattern.
Key changes:
- Enhanced CustomHandlerModel to support multiple type arguments instead of a single type name
- Added validation for CustomHandler methods with multiple generic parameters
- Modified source generation to properly format multiple generic arguments in method invocations
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| version.json | Bumped version from 2.1 to 2.2 |
| ServiceRegistrationModel.cs | Changed CustomHandlerModel to use EquatableArray for type arguments |
| AttributeModel.cs | Added tracking of type parameter counts for AssignableTo and CustomHandler |
| DependencyInjectionGenerator.cs | Updated source generation to handle multiple generic arguments |
| DependencyInjectionGenerator.ParseMethodModel.cs | Added validation for CustomHandler generic parameter compatibility |
| DependencyInjectionGenerator.FindServicesToRegister.cs | Enhanced logic to resolve multiple type arguments from matched types |
| CustomHandlerTests.cs | Added test case for the new generic argument resolution feature |
| README.md | Added documentation example for EF Core IEntityTypeConfiguration usage |
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.
No description provided.