Exemple #1
0
 public List <VehicleCountDTO> GetByType()
 {
     return(garage.GroupBy(v => v.GetType().Name)
            .Select(v => new VehicleCountDTO
     {
         TypeName = v.Key,
         Count = v.Count()
     })
            .ToList());
 }
Exemple #2
0
 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());
 }