【发布时间】:2009-04-28 07:03:45
【问题描述】:
感谢this 的帮助。
试过这个,没有运气..
我知道
from f in list
where f.bar == someVar
select f
可以写成
list.Where( f => f.bar == someVar );
是否可以创建类似的表达式
from f in foo
from b in f.bar
where b.something == someVar
select f;
?
编辑: 抱歉,我忘记了第二个示例中的 f.bar 是对象列表。
【问题讨论】:
-
您能解释一下为什么 Marc Gravell 的回答不起作用吗?它应该工作。另外,请尝试在那里回复,而不是两次问同一个问题。
-
这篇文章与其他的不同。不要投反对票。
-
不是重复的。
select b->select f会有所作为。 -
@Mehrdad 抱歉没有看到 select f vs select b。
-
我在问题中添加了进一步的解释。对混乱感到抱歉。感谢您的帮助。