LINQ is the answer. You can use it to “project” from your object collection to another collection – in this case a collection of object property values.
List<string> properties = objectList.Select(o => o.StringProperty).ToList();
LINQ is the answer. You can use it to “project” from your object collection to another collection – in this case a collection of object property values.
List<string> properties = objectList.Select(o => o.StringProperty).ToList();