Skip to content
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

Parsing boolean expressions with the QueryBuilder #1

Merged
merged 3 commits into from
Feb 20, 2016

Conversation

alexzubiaga
Copy link

While converting my old queries to Dapper linq I've run into an issue parsing expressions like:
Expression<Func<Person, bool>> expression = e => e.Id == 14 && e.Active;

The quick fix to make Dapper handle it is to rewrite it as:
Expression<Func<Person, bool>> expression = e => e.Id == 14 && e.Active == true;

But ReSharper complains about such things and following its refactoring suggestions would break the query.
This is why I've enhaced the QueryBuilder to handle this case.

QueryBuilder boolean member access expression unit test
added ability to parse a boolean member expression without a comparison with a value
added query builder unit test to project file
ryanwatson added a commit that referenced this pull request Feb 20, 2016
Parsing boolean expressions with the QueryBuilder
@ryanwatson ryanwatson merged commit c1f5c5c into ryanwatson:master Feb 20, 2016
@ryanwatson
Copy link
Owner

Thanks, I noticed this before, but short term just worked around it.

Also sorry for the late reply! I've been away for a couple weeks.

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.

2 participants