I have a list of objects that implement the .ToString() method. I was expecting to find a really easy to to call the .ToString() method for each item in the list, and get a list of strings.
Here is a way to do it in a foreach.
List<string> entityNames = new List<string>();
foreach (Entity parent in parents)
{
entityNames.Add(parent.ToString());
}
This is the best I came up with, is there a better way?
IList<string> entityNames2 = (from parent in parents where true select user.ToString()).ToList();