Fun(c) with C# 3.0

Uncategorized 9 October 2007 | 1 Comment

Looking through the list of predefined (or, in Microsoft’s parlance, standard) query operators defined in C# 3.0, there is one that stands out as missing: the ‘map’ function. However, with the new query expression syntax, this is trivial to define: public static IEnumerable<T> Map<F,T>(Func<F,T> func, IEnumerable<F> source) { return from it in source select func(it); [...]

Tagged in , , , , ,