Пример #1
0
        public CarListModel Build()
        {
            var cars = carRepository.All();

            var modelList = cars.Select(car => new CarListItemModel()
            {
                Id     = car.Id,
                Brand  = car.Brand,
                Model  = car.Model,
                Number = car.Number
            }).ToList();

            return(new CarListModel(modelList));
        }
Пример #2
0
 public List <Car> All()
 {
     return(_carRepo.All());
 }