Closed sdanyliv closed 2 years ago
Can you think about failing test case with the current implementation ? Thanks.
Well in bit operations it works, but when generated SQL, it creates also working but ineffective query.
You will never write StartDate > x & EndDate < y
and StartDate > x && EndDate < y
is correct one which is represented in expressions as AndAlso
I see. So it is easily testable having some right side side-effect and validating it is not called when left side is truthy.
@sdanyliv Adding test for this would take more time than I have now. If you have time for a unit test, it will be greatly appreciated. Pushed the fix.
No time, otherwise I'll just propose PR. I've seen this bug accidentally when analysed generated expression tree.
This line https://github.com/rsdn/CodeJam/blob/master/CodeJam.Main/Collections/QueryableExtensions.Ranges.cs#L192
generates
And
but should beAndAlso
. It should be not not bit operation but predicate.