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)); }
public List <Car> All() { return(_carRepo.All()); }