-
-
Notifications
You must be signed in to change notification settings - Fork 0
Fix nested SelectExpr code generation: parent class qualification, array types, and comment verbosity #222
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ea75a8e
Initial plan
Copilot a07c28e
Initial analysis of nested SelectExpr issues
Copilot af1da78
Fix Issues 1 and 3 for nested SelectExpr - Issue 2 still in progress
Copilot b97090d
Fix Issue 2 - array property types now correctly include [] suffix
Copilot 7c33e41
Refactor array type detection into helper method per code review
Copilot ca2b2d7
Address PR review comments: rename test file, remove qualifiers with …
Copilot 3d13c6f
Clarify that partial class declarations are required for nested DTO g…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
|
|
||
| namespace MinRepro; | ||
|
|
||
| public partial class Issue_NestedSelectExprTest | ||
| { | ||
| private readonly List<NestedEntity> TestData = []; | ||
|
|
||
| public void NestedSelectExpr_WithExplicitDtoTypes_ShouldWork() | ||
| { | ||
| var query = TestData.AsQueryable(); | ||
|
|
||
| var result = query | ||
| .SelectExpr<NestedEntity, NestedEntityDto>(x => new | ||
| { | ||
| x.Id, | ||
| x.Name, | ||
| // Use qualified name for nested partial classes | ||
| ItemsEnumerable = x.Items.SelectExpr<NestedItem, Issue_NestedSelectExprTest.NestedItemDtoEnumerable>(i => new | ||
arika0093 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| i.Id, | ||
| }), | ||
| ItemsList = x | ||
| .Items.SelectExpr<NestedItem, Issue_NestedSelectExprTest.NestedItemDtoList>(i => new { i.Id }) | ||
| .ToList(), | ||
| ItemsArray = x | ||
| .Items.SelectExpr<NestedItem, Issue_NestedSelectExprTest.NestedItemDtoArray>(i => new | ||
| { | ||
| i.Id, | ||
| i.Title, | ||
| SubItem = i.SubItems.Select(si => new { si.Id, si.Value }), | ||
| SubItemWithExpr = i.SubItems.SelectExpr<NestedSubItem, Issue_NestedSelectExprTest.NestedSubItemDto>( | ||
| si => new { si.Id, si.Value } | ||
| ), | ||
| }) | ||
| .ToArray(), | ||
| }) | ||
| .ToList(); | ||
| } | ||
|
|
||
| internal class NestedEntity | ||
| { | ||
| public int Id { get; set; } | ||
| public string Name { get; set; } = null!; | ||
| public List<NestedItem> Items { get; set; } = []; | ||
| } | ||
|
|
||
| internal class NestedItem | ||
| { | ||
| public int Id { get; set; } | ||
| public string Title { get; set; } = null!; | ||
| public List<NestedSubItem> SubItems { get; set; } = []; | ||
| } | ||
|
|
||
| internal class NestedSubItem | ||
| { | ||
| public int Id { get; set; } | ||
| public string Value { get; set; } = null!; | ||
| } | ||
|
|
||
| internal partial class NestedEntityDto; | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.