首页 > 解决方案 > 如果列表包含超过 1000 个元素,则 Where 子句中的 Contains() 在 Oracle 上失败,使用 LINQ ef core .net

问题描述

在使用 ef core linq 和 oracle 的 asp.net 中,无法使用 where 子句 contains(>1000) 获取大于一千个 id 的数据。有没有其他选择?

标签: asp.net.netoracleef-core-2.0

解决方案


是的; 将这些 ID 存储到表中并在子查询中使用它。例如:代替

where id in (1, 2, 3, ..., 5000)

这将是

where id in (select id from separate_table)

推荐阅读