updating from 8.21.140 results in ORA-00904
DbContext
.SubSiteGroupLevel
.Where(x => x.SubSiteId.Equals(subSiteId))
.Where(x => x.Group.GroupUser.Any(y => y.UserId.Equals(userId)))
.Any(x => x.Level <= level);
generates SQL
SELECT CASE
WHEN EXISTS (
SELECT 1
FROM "SubSiteGroupLevel" "s"
INNER JOIN "Group" "g" ON "s"."GroupId" = "g"."Id"
WHERE (((("s"."SubSiteId" = :subSiteId_0) AND (EXISTS (
SELECT 1
FROM "GroupUser" "g0"
WHERE (("g"."Id" = "g0"."GroupId") AND ("g0"."UserId" = :userId_1)))))) AND ("s"."Level" <= :level_2))) THEN true
ELSE false
END FROM DUAL;
which results in a ORA-00904
workaround :
DbContext
.SubSiteGroupLevel
.Where(x => x.SubSiteId.Equals(subSiteId))
.Where(x => x.Group.GroupUser.Any(y => y.UserId.Equals(userId)))
.Count(x => x.Level <= level) > 0;
which generates SQL:
SELECT COUNT(*)
FROM "SubSiteGroupLevel" "s"
INNER JOIN "Group" "g" ON "s"."GroupId" = "g"."Id"
WHERE (((("s"."SubSiteId" = :subSiteId_0) AND (EXISTS (
SELECT 1
FROM "GroupUser" "g0"
WHERE (("g"."Id" = "g0"."GroupId") AND ("g0"."UserId" = :userId_1)))))) AND ("s"."Level" <= :level_2));