public List <VehicleCountDTO> GetByType() { return(garage.GroupBy(v => v.GetType().Name) .Select(v => new VehicleCountDTO { TypeName = v.Key, Count = v.Count() }) .ToList()); }
public List <VehicleCountDTO> GetByType() { return(garage.GroupBy(v => v.GetType().Name) .Select(v => new VehicleCountDTO // .Select(v => new Tuple<string, int>(v.Key, v.Count()) { TypeName = v.Key, Count = v.Count() }) .ToList()); }