示例#1
0
        public IResult Update(IFormFile image, CarImage carImage)
        {
            var oldImagePath = _carImageDal.Get(i => i.Id == carImage.Id).ImagePath;


            var result = BusinessRules.Run(MaximumImageLimit(carImage.CarId), ImageExtension(image.FileName));

            if (result != null)
            {
                return(result);
            }

            carImage.ImagePath = ImageUploadHelper.UpdateImage(image, oldImagePath);
            carImage.Date      = DateTime.Now;
            _carImageDal.Update(carImage);

            return(new SuccessResult("Resim güncellendi."));
        }