Skip to content

Conversation

@borigas
Copy link
Collaborator

@borigas borigas commented Apr 29, 2019

rebels.Where(r => r.IsJedi) should be equivalent to rebels.Where(r => r.IsJedi == true), but was creating an invalid CouchDb query {"selector":"isJedi"}.

I handled it by explicitly hooking into .Where() as well as the && and || handlers. I can't think of anywhere else it's needed, but they may be some. There may be a better solution to doing this more universally too. I'm open to better solutions

@borigas
Copy link
Collaborator Author

borigas commented Apr 29, 2019

Forgot rebels.Where(r => !r.IsJedi). Adding a failing unit test and hoping you have a better idea how to do this universally.

@matteobortolazzo
Copy link
Owner

I'm not sure, but I think this is wrong for MemberExpressions that are not in the Where.
But I think a solution is possible

@matteobortolazzo
Copy link
Owner

So, what I am going to do this night is add a tree visitor for the Where node that replaces boolean member expressions with binary expression. So that the translator remains clear.

@matteobortolazzo matteobortolazzo deleted the BoolWithoutEquals branch May 2, 2019 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants