Last updated 5 years ago
Was this helpful?
Builds a new collection whose elements are the results of applying the given mapping function to each of the elements of the collection.
mapping
It works just like method of .
Parameters
Returns
Func<T, TResult> mapping
IEnumerable<T> source
IEnumerable<TResult>
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 }
Select
System.Linq