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

doesnotcontain should include null and empty values #12

Open
corydeppen opened this issue Aug 3, 2014 · 2 comments
Open

doesnotcontain should include null and empty values #12

corydeppen opened this issue Aug 3, 2014 · 2 comments

Comments

@corydeppen
Copy link
Contributor

When the doesnotcontain operator is used, ToExpression is currently just using !{field}.{comparison}(@{index}). This leaves out rows where the field value is null or empty, though. Checking the field for null or empty should produce a more accurate query and result. I'd be happy to submit a quick PR if you agree.

@burkeholland
Copy link
Contributor

Can you provide a specific test case where the results are not as desired? On a high level, I understand the issue, but it would be nice to have a more concrete example where something would fail.

@corydeppen
Copy link
Contributor Author

For example, when trying to look at rows where descriptions don't contain "brake", the SQL that is generated by EF looks like (NOT([Extent1].[PartDescription] LIKE '%brake%')). This will return rows that have a string value that doesn't contain "brake", as well as rows where the value is an empty string, but will not include nulls because NULL is NOT LIKE and NOT NOT LIKE.

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

No branches or pull requests

2 participants