LinqExtensions.

Map<TSource, TResult>(IEnumerable<TSource>, Func<TSource, TResult>) Method

Summary

Projects each element of a sequence into a new form.

Syntax

public static IEnumerable<TResult> Map<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)

Type Parameters

Name Description
TSource The type of the elements of source.
TResult The type of the value returned by selector.

Parameters

Name Type Description
source IEnumerable<TSource> A sequence of values to invoke a transform function on.
selector Func<TSource, TResult> A transform function to apply to each element.

Return Value

Type Description
IEnumerable<TResult> An System.Collections.Generic.IEnumerable`1 whose elements are the result of invoking the transform function on each element of source.