Skip to content

Comments

[release/10.0] Fix named query filter conventions#37738

Merged
AndriySvyryd merged 4 commits intorelease/10.0from
copilot/port-efcore-pull-37710
Feb 21, 2026
Merged

[release/10.0] Fix named query filter conventions#37738
AndriySvyryd merged 4 commits intorelease/10.0from
copilot/port-efcore-pull-37710

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Fixes #37708
Port of #37710

Description

Named query filters set by conventions cannot be overridden by explicit configuration in user code because of a missing ConfigurationSource in the implementation.

Customer impact

Customers who use conventions to automatically set named query filters cannot override those filters with explicit configuration in their OnModelCreating method.

There is no workaround other than not using named query filters or removing the convention entirely.

How found

Customer reported on 10.0.3

Regression

No, named query filters is a new feature in EF 10

Testing

Test added.

Risk

Low. The change is minimal.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copilot AI changed the title [WIP] Port changes from EF Core PR 37710 Port #37710: Fix named query filter override from convention Feb 18, 2026
Copilot AI requested a review from AndriySvyryd February 18, 2026 18:07
Copy link
Member

@AndriySvyryd AndriySvyryd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Update progress by rewriting the PR summary using this template:

Fixes #{number}

**Description**
{Issue description}

**Customer impact**
{How does the reported issue affects customer's app? Are there workarounds?}

**How found**
{Was it customer reported or found during verification? How many customers are affected?}

**Regression**
{Is it a regression from a released version? Which one?}

**Testing**
{How the changes were tested}

**Risk**
{Low/Medium/High, argument why}

Co-authored-by: AndriySvyryd <6539701+AndriySvyryd@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 18, 2026

@copilot Update progress by rewriting the PR summary using this template:

Done. The PR description has been updated using the servicing template.

Copilot AI requested a review from AndriySvyryd February 18, 2026 18:22
@AndriySvyryd AndriySvyryd changed the title Port #37710: Fix named query filter override from convention [release/10.0] Fix named query filter conventions Feb 18, 2026
@AndriySvyryd AndriySvyryd marked this pull request as ready for review February 18, 2026 21:00
@AndriySvyryd AndriySvyryd requested a review from a team as a code owner February 18, 2026 21:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports the EF 10 fix for named query filter override behavior so that filters added by conventions can be overridden by explicit user configuration during model building.

Changes:

  • Set ConfigurationSource.Explicit when creating named QueryFilter instances via EntityTypeBuilder.HasQueryFilter(string, ...).
  • Add a regression test validating convention-set named filters can be overridden via the public API.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/EFCore/Metadata/Builders/EntityTypeBuilder.cs Ensures named query filters created through the public builder carry ConfigurationSource.Explicit, enabling proper override semantics.
test/EFCore.Tests/Metadata/Internal/InternalEntityTypeBuilderTest.cs Adds coverage for overriding convention-set named query filters via explicit configuration.

Copy link
Member

@artl93 artl93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New feature. Customer reported. Approved.

…est.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@AndriySvyryd AndriySvyryd merged commit 5740ed8 into release/10.0 Feb 21, 2026
7 checks passed
@AndriySvyryd AndriySvyryd deleted the copilot/port-efcore-pull-37710 branch February 21, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants