I have some List:
List list = new List { 1, 2, 3, 4, 5 };
I want to apply some transformation to elements of my list.
Select
is a LINQ extension method and works on all IEnumerable
objects whereas ConvertAll
is implemented only by List
. The ConvertAll
method exists since .NET 2.0 whereas LINQ was introduced with 3.5.
You should favor Select
over ConvertAll
as it works for any kind of list, but they do the same basically.