C#: How to convert a list of objects to a list of a single property of that object?
List<string> firstNames = people.Select(person => person.FirstName).ToList();
And with sorting
List<string> orderedNames = people.Select(person => person.FirstName).OrderBy(name => name).ToList();
IList<string> firstNames = (from person in people select person.FirstName).ToList();
Or
IList<string> firstNames = people.Select(person => person.FirstName).ToList();
firstNames = (from p in people select p=>p.firstName).ToList();