1
有沒有辦法在Linq中線性化IEumerable<IEumerable<a>>
(或者一個優雅的解決方案)。在Linq中用Linq線性化#
我有一個方法,誰返回IEnumerable<b>
。我在b
的方法上使用Select
方法生成IEnumerable<a>
,結果爲IEnumerable<IEnumerable<a>>
。有沒有辦法將這些enumerable連接成一個IEnumerable<a>
-object?
是否有還內嵌相同呢?像'IEnumerable test = from B in B()where b.Value> 0 select b.ValueEnum;'但是用SelectMany? – 2012-03-09 21:45:26
@CommuSoft:'從B中的b()從a中b.Whatever()select thingy' – SLaks 2012-03-09 22:09:35
不錯的一個!謝謝! – 2012-03-09 22:14:56