-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for dollar count segment in filter #2521
Add support for dollar count segment in filter #2521
Conversation
src/Microsoft.AspNet.OData.Shared/Query/Validators/FilterQueryValidator.cs
Outdated
Show resolved
Hide resolved
b1f79bc
to
953d9aa
Compare
src/Microsoft.AspNet.OData.Shared/Query/Validators/FilterQueryValidator.cs
Outdated
Show resolved
Hide resolved
@@ -398,7 +398,7 @@ public override QueryNode Visit(UnaryOperatorNode nodeIn) | |||
/// <returns>The translated node.</returns> | |||
public override QueryNode Visit(CountNode nodeIn) | |||
{ | |||
return new CountNode((CollectionNode)nodeIn.Source.Accept(this)); | |||
return new CountNode((CollectionNode)nodeIn.Source.Accept(this), nodeIn.FilterClause, nodeIn.SearchClause); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you cater for $search
as well? If yes, maybe you should mention that in the PR description and add a test(s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$search is not supported in WebAPI.
This code ensures we return the correct query node after adding Parameter alias.
src/Microsoft.AspNet.OData.Shared/Query/Validators/FilterQueryValidator.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments, otherwise looks good
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
Issues
This pull request fixes issue #xxx.
Description
Add support for the following:
$filter=navProp/$count gt 10
$filter=navProp/$count($filter=prop gt 1) gt 2
$filter = collectionValuedProp/$count gt 10
$filter=collectionValuedProp/$count($filter=prop gt 1) gt 2
Checklist (Uncheck if it is not completed)
Additional work necessary
If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.