Skip to content

[release/11.0] Backport: named query filter set by convention cannot be overridden by explicit configuration#37754

Closed
Copilot wants to merge 2 commits intorelease/10.0from
copilot/backport-servicing-release-11-0
Closed

[release/11.0] Backport: named query filter set by convention cannot be overridden by explicit configuration#37754
Copilot wants to merge 2 commits intorelease/10.0from
copilot/backport-servicing-release-11-0

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

EntityTypeBuilder.HasQueryFilter(string, LambdaExpression) created a QueryFilter without a ConfigurationSource, leaving it null. When competing against a convention-set filter (ConfigurationSource.Convention), the null source lost the override check — silently discarding the explicit user filter.

Changes

  • EntityTypeBuilder.cs: Pass ConfigurationSource.Explicit in HasQueryFilter(string, LambdaExpression), matching the behavior of the unnamed overload
  • InternalEntityTypeBuilderTest.cs: Add Can_override_named_query_filter_from_convention_with_explicit_configuration test
// In a convention:
builder.HasQueryFilter("filter", e => e.TenantId == tenantId); // ConfigurationSource.Convention

// In OnModelCreating — previously silently ignored, now correctly overrides:
modelBuilder.Entity<Order>().HasQueryFilter("filter", e => !e.IsDeleted);

Backport of #37710 / #37738 to release/11.0-preview2.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: roji <1862641+roji@users.noreply.github.com>
Copilot AI changed the title [WIP] Submit backport servicing PR for release 11.0 [release/11.0] Backport: named query filter set by convention cannot be overridden by explicit configuration Feb 20, 2026
Copilot AI requested a review from roji February 20, 2026 08:31
@roji roji closed this Feb 20, 2026
@AndriySvyryd AndriySvyryd deleted the copilot/backport-servicing-release-11-0 branch February 26, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants