Conversation
The first member after a collection had to match in the exact case, and a member that did not match threw NullReferenceException. Every other segment of a property path ignores the case. Resolve the members after a collection like every other segment. BREAKING CHANGE: a child collection member in another case, for example ingredients.name, now filters by the member. An unknown member after a collection now follows AllowUnknownProperties and no longer throws NullReferenceException.
pdevito3
force-pushed
the
fm/qk-breaking-child-collection-case
branch
from
October 1, 2026 21:36
f34cc9a to
c4a474f
Compare
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.
For later consideration in a major version. Do not merge now. #134 restored the v1.14.2 behavior to keep v1.x compatible (restore commit
0f1d864). This PR re-appliesb562d00(#113). The captain decides on this PR separately.Summary
PropertyResolver.ResolveMemberPathresolves each segment after a collection like every other segment: it ignores the letter case, and a segment that does not match is an unknown property.v1.14.2 behavior (and main)
NullReferenceException.AllowUnknownPropertiesdoes not change this.New behavior
UnknownFilterPropertyException, or the clause is ignored whenAllowUnknownPropertiesis on, like an unknown property in any other place.Example
NullReferenceException.x => x.Ingredients.Select(y => y.Name).Any(z => (z == "flour")).Justification
The case rule after a collection was not documented, and it did not match the rest of the path. A
NullReferenceExceptiondoes not tell the caller what is wrong. It also skipsAllowUnknownProperties.Migration
A caller that catches
NullReferenceExceptionfor this input must catchUnknownFilterPropertyException, or setAllowUnknownProperties.README
No change. The README does not document the case rule for child collections.
Tests
These tests come back from main before #134, in unit
FilterParserTests:child_collection_member_in_another_case_throws->child_collection_member_resolves_in_any_caseunknown_child_collection_member_throws_when_unknown_properties_are_allowed,member_after_a_child_collection_member_resolves_in_any_case, andnested_child_collection_member_in_another_case_throwsare removed. They held the v1.14.2 behavior.New integration test in
DatabaseFilteringTests(Postgres):can_filter_by_child_collection_member_in_another_case.dotnet test: 467 unit tests and 298 Postgres integration tests (Testcontainers) pass, 0 failures.Rebase on main
This branch is rebased on current main. On main, a segment that is not after a collection matches members in the order of
Expression.PropertyOrField: a public property, a public field, a non-public property, and then a non-public field. With this PR, a segment after a collection uses the same order. As a result, a non-public member after a collection also resolves. #161 limits every segment to public members.