Let's say I have an object that looks like this:
private class Group
{
public int id { get; set; }
public string name { get; set; }
public int memberCount { get; set; }
}
And then I have a List<Group> called groups. But, now what I need is just a list of all of the names.
List<string> names = group.???
So, just to be clear, if groups looks like this:
id name memberCount
-----------------------------
1, "Math Club", 24
2, "Chess Club", 12
3, "Drama Club", 19
Then what I want is a list that looks like this:
"Math Club"
"Chess Club"
"Drama Club"
objectis a class that all other classes inherit from, therefore and you can actually have aList<object>, which is not the exact same as aList<SomeOtherClass>