Map
Builds a new collection whose elements are the results of applying the given mapping function to each of the elements of the collection.
It works just like Select method of System.Linq.
Parameters
Returns
Func<T, TResult> mapping
IEnumerable<T> source
IEnumerable<TResult>
Usage
Multiplying the values by two
//IEnumerable<int> source = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
IEnumerable<int> result = source.Map(value => value * 2);
//result = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20 }Last updated
Was this helpful?