【发布时间】:2011-04-28 14:46:15
【问题描述】:
我想将以下谓词设置为用表达式语法编写的 linq 语句的 where 子句。
Expression<Func<Purchase, bool>> condition = p => p.Price > 100;
from purchase in dc.GetTable<Purchase>()
where condition
select ...
但是,编译器无法确定使用哪个位置:IQuaryable 或 IEnumerable。 如果不将 linq 表达式转换为方法链,如何解决这个问题?
【问题讨论】:
标签: c# .net linq linq-to-sql