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

Bug on where clause with composite string #623

Closed
GrandStrateguerre opened this issue Aug 9, 2022 · 3 comments
Closed

Bug on where clause with composite string #623

GrandStrateguerre opened this issue Aug 9, 2022 · 3 comments
Assignees

Comments

@GrandStrateguerre
Copy link

GrandStrateguerre commented Aug 9, 2022

Here is what to include in your request to make sure we implement a solution as quickly as possible.

1. Description

Try to execute a query with a where as :

.Where("field1 == @0 & Field2 <> @1", "xxx", "")

The second parameter is empty string.

2. Exception

No excexption raise

3. technical details

Get the log of what entity generates :

WHERE (('XXX' = "Extent1"."field1 ") AND ("Extent1"."field1 " IS NOT NULL) AND 
( NOT (('' = "Extent1"."Field2 ") AND ("Extent1"."Field2 " IS NOT NULL))))

The error is in Field2 " IS NOT NULL=> shoud be IS NULL without NOT because we set a NOT before :
image

with Field2 != @1 => gives the same issue

@GrandStrateguerre
Copy link
Author

Finally à replace by :

image

and it works.

It sems that a empty string is not interpreted like a null .
Is is interpreded like a char.

And we see EF always add IS NOT NULL....

it is still a bit confusing :)

I let you close or do something ?

@StefH
Copy link
Collaborator

StefH commented Aug 14, 2022

#625

@StefH
Copy link
Collaborator

StefH commented Aug 14, 2022

@GrandStrateguerre
I'll close this.

@StefH StefH closed this as completed Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants