C#C
C#4y ago
Thinker

Lambda or extension method reference [Answered]

If you have an extension which maps a type A to another type B and you have an enumerable of type A which you want to turn into an enumerable of type B, should you prefer .Select(x => x.ToB()) or .Select(Extensions.ToB)? The first I assume allocates an extra unnecessary lambda which the second doesn't?
Was this page helpful?