Skip to content

Support collection property paths on the right side of a filter comparison #131

Description

@pdevito3

Summary

Support a property path through a collection on the right side of a filter comparison.

Examples, with a Recipe that has a Title and a collection of Ingredients:

  • Title == Ingredients.Name: recipes where an ingredient has a name equal to the title.
  • Title @=* Ingredients.Name: recipes where the title contains the name of an ingredient (case-insensitive).

The expected expressions:

x => x.Ingredients.Any(i => i.Name == x.Title)
x => x.Ingredients.Any(i => x.Title.ToLower().Contains(i.Name.ToLower()))

Current behavior

Design questions

  • Does a collection path on the right side mean "any" or "all"? A collection path on the left side uses "any" today.
  • What happens when both sides are collection paths, for example Ingredients.Name == Tags.Name?
  • How do PreventFilter, query names, and MaxPropertyDepth apply to a right-side collection path?
  • Which operators are valid? The string operators (@=, _=, _-=, and their case-insensitive and negated forms) and the comparison operators are the main set.

Relation to #129

If this feature ships, #129 can close in favor of it. The feature changes the current exception to a correct result.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions