Skip to content

fix(filter): ignore a fully prevented clause by its query name - #194

Merged
pdevito3 merged 1 commit into
mainfrom
backport/152
Oct 9, 2026
Merged

pdevito3 merged 1 commit into
mainfrom
backport/152

Conversation

@pdevito3

@pdevito3 pdevito3 commented Oct 9, 2026

Copy link
Copy Markdown
Owner

A filter that used the query name of a property with PreventFilter and PreventSort threw InvalidOperationException. The member name of the same property gives an ignored clause. Now the query name gives the same ignored clause as the member name, and IgnoredClauseBehavior controls it.

Behavior change: this filter no longer throws InvalidOperationException. QueryKitPropertyMappings.ReplaceAliasesWithPropertyPaths no longer throws for this query name.

Examples (Title has HasQueryName("name").PreventFilter().PreventSort(), default ReplaceWithTrue):
name == "x" && Age > 100
before: InvalidOperationException: 'Title' is not allowed for filtering or sorting.
after: (True == True) AndAlso (x.Age > 100)
name == "x" || Age > 100 (IgnoredClauseBehavior.Remove)
before: InvalidOperationException
after: x.Age > 100

From #152 on v2.

A filter that used the query name of a property with PreventFilter and PreventSort threw InvalidOperationException. The member name of the same property gives an ignored clause. Now the query name gives the same ignored clause as the member name, and IgnoredClauseBehavior controls it.

Behavior change: this filter no longer throws InvalidOperationException. QueryKitPropertyMappings.ReplaceAliasesWithPropertyPaths no longer throws for this query name.

Examples (Title has HasQueryName("name").PreventFilter().PreventSort(), default ReplaceWithTrue):
  name == "x" && Age > 100
    before: InvalidOperationException: 'Title' is not allowed for filtering or sorting.
    after:  (True == True) AndAlso (x.Age > 100)
  name == "x" || Age > 100 (IgnoredClauseBehavior.Remove)
    before: InvalidOperationException
    after:  x.Age > 100

From #152 on v2.
@pdevito3
pdevito3 merged commit bc9a2ce into main Oct 9, 2026
2 checks passed
@pdevito3
pdevito3 deleted the backport/152 branch October 9, 2026 20:27
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.

1 participant