c# - Passing the Select<> to a Method -


i have code

enumerable.range(100, 100)           .select(x => x / 10) 

is there way can pass line .select(x => x / 10) method. intention pass results method select happens. want avoid foreach here.

enumerable.range(100, 100)           .select(x => { var r = x / 10; foo(r); return r; }) 

if don't want consume results, should use foreach:

foreach (var x in enumerable.range(100, 100)) {     foo(x / 10); } 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -