Address review comments for partial property loading#37882
Open
roji wants to merge 2 commits intodotnet:mainfrom
Open
Address review comments for partial property loading#37882roji wants to merge 2 commits intodotnet:mainfrom
roji wants to merge 2 commits intodotnet:mainfrom
Conversation
Move constructor-binding validation from ValidateConstructorBindingAutoLoaded into ValidateAutoLoaded, since non-autoloaded properties are rare and the check should only run when one is encountered. Simplify IsAutoLoaded filter in StructuralTypeMaterializerSource by moving Where() before Cast<IPropertyBase>(). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Addresses follow-up review feedback for the “partial property loading” work by tightening when auto-load validation runs and simplifying an auto-load filter in the materializer pipeline.
Changes:
- Moved constructor-binding vs. “not auto-loaded” validation to run only when encountering a property configured as not auto-loaded.
- Simplified
StructuralTypeMaterializerSourceproperty filtering by applyingWhere()beforeCast<IPropertyBase>().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/EFCore/Query/Internal/StructuralTypeMaterializerSource.cs | Simplifies the property filter for materialization to use direct IProperty access before casting. |
| src/EFCore/Infrastructure/ModelValidator.cs | Refactors auto-load validation to incorporate constructor-binding validation in ValidateAutoLoaded instead of a separate per-type pass. |
You can also share your feedback on Copilot code review. Take the survey.
- Check constructor bindings across derived types, not just the declaring type - Update XML doc summary to mention constructor bindings - Add regression test for derived type constructor consuming base property Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Addresses the unresolved review comments from #37857:
ValidateConstructorBindingAutoLoadedintoValidateAutoLoaded, since non-autoloaded properties are rare and the check should only run when one is encountered.IsAutoLoadedfilter inStructuralTypeMaterializerSourceby movingWhere()beforeCast<IPropertyBase>()for cleaner direct property access.