Issue generated sql by using hasflag
Posted: Tue 09 Feb 2021 09:33
If your linq2Sql in ef core looks like
The generated sql is bugy. And looks like
I use the nuget packaged Devart.Data.Oracle.EFCore (Version 9.14.1180).
If you use the bit-operator "&" the sql works correctly.
Code: Select all
...
from item in items
where
item.Status.HasFlag(MyStatusEnum.Value1)
Code: Select all
...
WHERE TO_NUMBER(BITAND("d".Status, Value1)) = 2
If you use the bit-operator "&" the sql works correctly.