Ejemplo n.º 1
0
        public IResult Delete(CarImage carImage)
        {
            var image = _carImageDal.Get(c => c.Id == carImage.Id);

            if (image == null)
            {
                return(new ErrorResult(Messages.ImageNotFound));
            }
            ImageUploadHelper.Delete(image.ImagePath);
            _carImageDal.Delete(carImage);
            return(new SuccessResult(Messages.ImageDeleted));
        }
Ejemplo n.º 2
0
        private IResult CarImageDeleteControl(CarImage carImage)
        {
            var image = _carImageDal.Get(c => c.Id == carImage.Id);

            if (image == null)
            {
                return(new ErrorResult(Messages.ImageNotFound));
            }
            ImageUploadHelper.Delete(image.ImagePath);


            return(new SuccessResult());
        }