Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix ParentRequires not working with EF Core projections #8749

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

Open
PHILLIPS71 wants to merge 5 commits into ChilliCream:main
base: main
Choose a base branch
Loading
from PHILLIPS71:jp/parent-requires-ef-core-projection

Conversation

@PHILLIPS71
Copy link
Contributor

@PHILLIPS71 PHILLIPS71 commented Sep 30, 2025

Summary

Fixes an issue where ParentRequires functionality was not working when using EF Core projections. Required parent properties were not being included in the generated EF Core queries, causing computed properties to incorrectly resolvers if parent data wasn't also referenced in the query.

Problem

The ParentRequires feature worked correctly with the built-in SelectionExpressionBuilder but failed when using EF Core projections through UseProjection(). This happened because:

  • SelectionExpressionBuilder processes field requirements and includes them in projections
  • QueryableProjectionVisitor (used by EF Core projections) did not have any logic to handle field requirements
  • Required parent properties were never added to the EF Core query, leaving resolvers without access to the necessary data

Solution

Added field requirements processing to QueryableProjectionVisitor following the same pattern as SelectionExpressionBuilder

Changes Made

Core Implementation

  • QueryableProjectionVisitor.cs: added requirements processing logic following SelectionExpressionBuilder patterns

Tests

  • IntegrationTests.cs: added tests for both string-based and expression-based ParentRequires scenarios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /