Есть ли эквивалент функции F # List.map в С#? т.е. применить функцию к каждому элементу в списке и вернуть новый список, содержащий результаты.
Что-то вроде:
public static IEnumerable<TResult> Map<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> funky)
{
foreach (TSource element in source)
yield return funky.Invoke(element);
}
Есть ли уже встроенный способ или я должен просто написать пользовательское расширение?