When using EFCore value conversions for nullable enum properties and performing a comparison in a where clause, Devart ignores the value expression and generates a query using the numeric value of the enum.
When using a non-nullable enum value, it works. E.g.:
Code: Select all
dbContext
.Set<Rider>()
.Where(_ => _.Mount == EquineBeast.Mule)
.ToList();
Code: Select all
dbContext
.Set<Rider>()
.Where(_ => _.Mount != null && _.Mount.Value == EquineBeast.Mule)
.ToList();
Code: Select all
SELECT "_".ID,
"_".MOUNT
FROM RIDER "_"
WHERE ("_".MOUNT IS NOT NULL)
AND ("_".MOUNT = 1) /* This should be "_".MOUNT = 'Mule' */
A repository reproducing the issue can be found here: https://github.com/LBRitsSES/devart-efc ... -bug-repro