using System.Collections.Generic;
public string Name { get; set; }
public int Age { get; set; }
public static void Main()
IEnumerable<string> catNames = cats.Select(cat => cat.Name);
foreach(string name in catNames)
IEnumerable<int> catAges = cats.Select(cat => cat.Age);
foreach(int age in catAges)
IEnumerable<string> dogNames = dogs.Select(dog => dog.Name);
foreach(string name in dogNames)
IEnumerable<string> combinedNames = dogs.Select(dog => dog.Name).Concat(cats.Select(cat => cat.Name));
List<string> combinedNamesList = combinedNames.ToList();
Console.WriteLine(combinedNamesList[5]);
new Pet { Name="Barley", Age=8 },
new Pet { Name="Boots", Age=4 },
new Pet { Name="Whiskers", Age=1 }
new Pet { Name="Bounder", Age=3 },
new Pet { Name="Snoopy", Age=14 },
new Pet { Name="Fido", Age=9 }