forked from panoramicdata/PanoramicData.OData.Client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathissue2-fix-comment.txt
More file actions
20 lines (12 loc) · 885 Bytes
/
issue2-fix-comment.txt
File metadata and controls
20 lines (12 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
## Fixed in commit c1a9e10
The OR operator precedence issue has been fixed. OR expressions are now properly wrapped in parentheses when they appear as operands of AND expressions.
### Changes Made
1. Modified `ParseBinaryExpression` in `ODataQueryBuilder.ExpressionParsing.cs` to track parent operator context
2. OR expressions are wrapped in parentheses when their parent operator is AND
3. Same fix applied to lambda parsing in `ODataQueryBuilder.LambdaParsing.cs` for Any/All expressions
### Example
Input: `e.Status == "Active" && (e.Name.Contains("foo") || e.Name.Contains("bar"))`
Before: `Status eq 'Active' and contains(Name,'foo') or contains(Name,'bar')` (incorrect precedence)
After: `Status eq 'Active' and (contains(Name,'foo') or contains(Name,'bar'))` (correct)
### Tests
All 348 unit tests pass, including 10 new tests specifically for OR precedence scenarios.