예제 #1
0
        public IResult Update(IFormFile image, CarImage carImage)
        {
            var theImage = _carImageDal.Get(c => c.Id == carImage.Id);

            if (theImage == null)
            {
                return(new ErrorResult("Image Not Found"));                          //Seçilen bir resim yoksa bunu ver.
            }

            var updatedFile = ImageUploadHelper.Update(image, theImage.ImagePath);

            theImage.ImagePath = updatedFile.Message;
            theImage.Date      = DateTime.Now;
            _carImageDal.Update(theImage);
            return(new SuccessResult(Messages.ImageUpdated));
        }