-
Notifications
You must be signed in to change notification settings - Fork 475
Fix bug in Filter Any within Expand #2530
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
Fix bug in Filter Any within Expand #2530
Conversation
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) |
if (!_lambdaParameters.TryGetValue(rangeVariable.Name, out parameter)) | ||
|
||
// Create a Parameter Expression for rangeVariables which are not $it Lambda parameters or $this. | ||
if (!_lambdaParameters.TryGetValue(rangeVariable.Name, out parameter) && rangeVariable.Name != ODataThisParameterName) |
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.
In the comment you talk about creating parameter expression for range variables that are neither $it lambda parameters or $this but your change only added && rangeVariable.Name != ODataThisParameterName
. Will that suffice?
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.
This code !_lambdaParameters.TryGetValue(rangeVariable.Name, out parameter)
ensures we don't create Parameter expressions for lambda parameters
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.
LGTM
Issues
This pull request fixes issue OData/AspNetCoreOData#233
Description
Issue was raised in the WebAPI v8 repo. We will fix in this repo and that one too.
Generally in Select and Expand binder in ODL, we add a
$this
range variable. When binding AnyNode within expand/select in WebApi, we create parameter expression for range variables which are not$it
. We also need to ignore the$this
range variables.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.