Exemplo n.º 1
0
        private IResult AddPhotoToCar(List <string> photoPaths, string description, Car car)
        {
            List <Photo> carPhotos = new List <Photo>();

            foreach (var photoPath in photoPaths)
            {
                Photo carPhoto = new Photo
                {
                    Path        = photoPath,
                    Description = description,
                    Car         = car
                };
                carPhotos.Add(carPhoto);
            }

            _photoService.AddCarPhotos(carPhotos);
            return(new SuccessResult());
        }