Page 1 of 1

Issue generated sql by using hasflag

Posted: Tue 09 Feb 2021 09:33
by Flo
If your linq2Sql in ef core looks like

Code: Select all

...
from item in items
where
item.Status.HasFlag(MyStatusEnum.Value1)
The generated sql is bugy. And looks like

Code: Select all

...
WHERE TO_NUMBER(BITAND("d".Status, Value1)) = 2
I use the nuget packaged Devart.Data.Oracle.EFCore (Version 9.14.1180).

If you use the bit-operator "&" the sql works correctly.

Re: Issue generated sql by using hasflag

Posted: Thu 11 Feb 2021 15:15
by Shalex
Thank you for your report. We have reproduced the issue and are investigating it. We will notify you about the result.

Re: Issue generated sql by using hasflag

Posted: Sat 20 Feb 2021 12:30
by Shalex
The bug with translating Enum.HasFlag to SQL in EF Core 3 and EF Core 5 is fixed in dotConnect for Oracle v9.14.1204: viewtopic.php?f=1&t=44490.

Re: Issue generated sql by using hasflag

Posted: Tue 09 Mar 2021 07:57
by Flo
Cool, thanks!