I have DTO class that defines order line like this:
public class Line { public string Sku { get; set; } public int Qty { get; set; } }
You can use:
var mySKUs = myLines.Select(l => l.Sku).ToList();
The Select method, in this case, performs a mapping from IEnumerable to IEnumerable (the SKU), then ToList() converts it to a List.
Select
IEnumerable
ToList()
List
Note that this requires using System.Linq; to be at the top of your .cs file.
using System.Linq;