linq:交叉连接的表达式树语法是什么

时间:2010-11-08 19:05:05

标签: linq expression-trees

如何在表达式树语法中编写此linq查询

from x in 100.To(999)
from y in 100.To(999)
let product = x * y
where product.IsEven()
select product

1 个答案:

答案 0 :(得分:1)

相当于'from x from y select'是'SelectMany'关键字,与其他'Select'一起使用:

100.To(999).SelectMany(x => 100.To(999).Select(y => x * y))
.Where(x => x.IsEven())