Exemple #1
0
        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);
        }
Exemple #2
0
 public IEnumerable <IGrouping <Type, Vehicle> > ListOfVehicleTypes()
 {
     return(garage.GroupBy(x => x.GetType()));
 }