-
Notifications
You must be signed in to change notification settings - Fork 15
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
ExecuteDelete missing parenthesis #224
Comments
I think the translation is correct. it all based on Oper precedence I think. Try duplicating last part with OR: see if parenthesis appear |
Not sure if this is what you are looking for, but the result is still not right to me. var query = context
.GetSession()
.EntitySet<IAuthSession>()
.Where(x => (x.Id == authSession.Id) || (x.IdentityId == authSession.IdentityId && (x.Expires < MyApp.UtcNow || x.Expires < MyApp.UtcNow)));
context.GetSession().ExecuteDelete<IAuthSession>(query); DELETE FROM "vrewards_dev1"."AuthSession" |
then I am puzzled, what is wrong with the result for you? Remember that "=" is operation too, and it has the highest precedence value. AND has higher precedence than OR; so SQL is equivalent to source expression even without parenthesis |
Ahhh...I didn't aware of the operator precedence...sorry about that..... |
Hi @rivantsov ,
The execution query is missing parenthesis which could have different results.
From log:
DELETE FROM "vrewards_dev1"."AuthSession"
WHERE "Id" = @p0 OR "IdentityId" = @p1 AND "Expires" < @p2;
-- Parameters: @p0='01H4HHVCP2KG4WPXBHBCG3FCDD', @p1='$01H4GA9VFWMRXEBW699XSZVKZR', @p2=[2023-07-04T22:55:38]
-- Time 5.6967 ms, [2023/07/04 22:55:38]
The text was updated successfully, but these errors were encountered: