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
Post a Comment