public string ListAllTypes() { string output = ""; if (theGarage.Count > 0) { var typedGarage = theGarage.GroupBy(x => x.GetType().Name); foreach (var t in typedGarage) { output += t.Count() + " " + t.Key + Environment.NewLine; } } return(output); }
public IEnumerable <IGrouping <Type, Vehicle> > ListOfVehicleTypes() { return(garage.GroupBy(x => x.GetType())); }