mysql - Entity Framework - 选择的嵌套级别太高

标签 mysql linq frameworks entity

你好 stackoverflow,我在使用 LINQ 查询时遇到了问题。

from ri in App.db.RecipeIngredients  
join i in App.db.Ingredients on ri.IngredientID equals i.ID  
join r in App.db.Recipes on ri.RecipeID equals r.ID  
where recipeIDs.Any(rid => rid == ri.RecipeID)  
group new Result()  
{  
   recipe = ri.Recipe,  
   ingredient = ri.Ingredient,  
   quantity = ri.Quantity  
} by ri.RecipeID

这是我到目前为止编写的代码,recipeIDs 是一个整数列表。但是当 recipeIDs 列表超过 30 个整数时,程序会因错误“选择的嵌套级别太高”而中断,我一直在谷歌搜索,但此时我不知道如何修复它。你们能帮帮我吗?

最佳答案

我已经自己解决了这个问题,修复在什么地方,我用:

where recipeIDs.Contains(ri.RecipeID)

关于mysql - Entity Framework - 选择的嵌套级别太高,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27104864/

相关文章:

c++ - 用C++读取二进制数据并写入MySQL

mysql - 从表中删除重复记录

c# - LINQ 包含追加 % 和转义 %

java - 你觉得 java.util.logging 足够了吗?

python - Django ;我如何从自定义 'skin' 目录中提供模板/图像/css/js?

mysql - 运行 mySQL 查询时从两个表中获取正确的搜索结果

mysql - 如何同时对DISTINCT和COUNT进行SQL查询

linq - LInq 中的 Sum(AND(column))

c# - 带有 IN 子句的 SQL 到 LINQ

ios - 何时在 Xcode 上链接框架/库?