【发布时间】:2013-04-25 07:49:57
【问题描述】:
所以我尝试按照this 示例在此 LINQ 查询的 where 子句中添加子查询。
var innerquery =
from app in context.applications
select new { app.app_id };
IEnumerable<postDatedCheque> _entityList = context.postDatedCheques
.Where(e => innerquery.Contains(e.appSancAdvice.application.app_id));
目标是从 postDatedCheques 中选择那些在 applications 表中具有 app_id 的记录。
但我在 where 子句中遇到以下错误:
- 委托“System.Func”不 取 1 个参数
- 无法将 lambda 表达式转换为“字符串”类型,因为它不是 委托类型
- “System.Linq.IQueryable”不包含 “包含”的定义和最佳扩展方法重载 'System.Linq.ParallelEnumerable.Contains(System.Linq.ParallelQuery, TSource)' 有一些无效参数
- 实例参数:无法从 'System.Linq.IQueryable' 到 'System.Linq.ParallelQuery'
我写错了什么?
【问题讨论】:
标签: c# asp.net linq entity-framework linq-to-entities