Another alternative to Select and SelectMany is to write your own extension method.
public static IEnumerable<U> Map<T, U>(this IEnumerable<T> s, Func<T, U> f) { foreach (var item in s) yield return f(item); }
Thanks to Wes Dyer for this sweet extension method! :) See more.
Annie Lagang Mar 29 '12 at 8:37 2012-03-29 08:37
source share