Fix issue with runtime resolve on open generic class#198
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a runtime resolution issue in ProjectionExpressionResolver when resolving [Projectable] members on closed generic type instantiations by ensuring parameter-type name generation is based on the member as declared on the generic type definition (matching the source generator’s naming).
Changes:
- Update runtime reflection-based resolver logic to inspect methods/constructors as declared on the generic type definition when the declaring type is normalized to an open generic definition.
- Add runtime regression tests that mimic generated expression factory types in the test assembly and validate reflection resolution + resolved lambda signatures.
- Add/extend generator snapshot coverage for generic-class methods whose parameters are the class type parameter.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/EntityFrameworkCore.Projectables.Tests/Services/ProjectionExpressionResolverGenericTypeTests.cs | Adds runtime regression tests and hand-crafted “generated” classes to validate reflection resolution on closed generic types. |
| tests/EntityFrameworkCore.Projectables.Generator.Tests/GenericTests.GenericClassMethodsWithTypeParameterParameter.verified.txt | Adds the verified snapshot for generated output of a generic-class method taking the class type parameter. |
| tests/EntityFrameworkCore.Projectables.Generator.Tests/GenericTests.cs | Adds a generator regression test to exercise generic-class methods with type-parameter parameters. |
| src/EntityFrameworkCore.Projectables/Services/ProjectionExpressionResolver.cs | Adjusts reflection resolver to compute parameter type names from the member on the generic type definition (method/ctor). |
tests/EntityFrameworkCore.Projectables.Generator.Tests/GenericTests.cs
Outdated
Show resolved
Hide resolved
github-merge-queue bot
pushed a commit
to DFE-Digital/teaching-record-system
that referenced
this pull request
Apr 7, 2026
Updated [EntityFrameworkCore.Projectables](https://github.com/EFNext/EntityFrameworkCore.Projectables) from 6.0.1 to 6.0.2. <details> <summary>Release notes</summary> _Sourced from [EntityFrameworkCore.Projectables's releases](https://github.com/EFNext/EntityFrameworkCore.Projectables/releases)._ ## 6.0.2 ## What's Changed * Fix issue with runtime resolve on open generic class by @PhenX in EFNext/EntityFrameworkCore.Projectables#198 **Full Changelog**: EFNext/EntityFrameworkCore.Projectables@v6.0.1...v6.0.2 Commits viewable in [compare view](EFNext/EntityFrameworkCore.Projectables@v6.0.1...v6.0.2). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: James Gunn <james@gunn.io>
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.