-
Notifications
You must be signed in to change notification settings - Fork 30
Add support for projectable method overloads #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add support for projectable method overloads #143
Conversation
Co-authored-by: PhenX <42170+PhenX@users.noreply.github.com>
Co-authored-by: PhenX <42170+PhenX@users.noreply.github.com>
Co-authored-by: PhenX <42170+PhenX@users.noreply.github.com>
Co-authored-by: PhenX <42170+PhenX@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for projectable method overloads by including parameter type information in the generated class names. Previously, methods with the same name but different parameter types would cause name collisions in the generated code. The solution encodes parameter types into the generated class name (e.g., _Method_P0_int_P1_string) to make each overload unique.
Changes:
- Modified the source generator to collect parameter type names and include them in generated class names using Roslyn's
SymbolDisplayFormat.FullyQualifiedFormat - Updated the runtime resolver to reconstruct parameter type names from reflection and match them to generated classes
- Added comprehensive tests for method overloads with different parameter types and counts
Reviewed changes
Copilot reviewed 42 out of 42 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/EntityFrameworkCore.Projectables.Generator/ProjectableDescriptor.cs | Added ParameterTypeNames property to store parameter types |
| src/EntityFrameworkCore.Projectables.Generator/ProjectableInterpreter.cs | Collects parameter type names from method symbols using Roslyn |
| src/EntityFrameworkCore.Projectables.Generator/ProjectionExpressionGenerator.cs | Passes parameter type names to class name generator |
| src/EntityFrameworkCore.Projectables/Services/ProjectionExpressionClassNameGenerator.cs | Encodes parameter types into generated class names with sanitization |
| src/EntityFrameworkCore.Projectables/Services/ProjectionExpressionResolver.cs | Reconstructs parameter type names at runtime to find generated classes |
| tests/EntityFrameworkCore.Projectables.Generator.Tests/ProjectionExpressionGeneratorTests.cs | Added tests for method overloads with different types and counts |
| tests/EntityFrameworkCore.Projectables.FunctionalTests/MethodOverloadsTests.cs | End-to-end tests verifying overload resolution works correctly |
| tests/*/verified.txt files | Updated baseline snapshots to reflect new naming convention with parameter types |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fixes #58