public IResult Delete(Image image) { var result = _imageDal.Get(c => c.ImageId == image.ImageId); ImageFileHelper.Delete(result.ImagePath); _imageDal.Delete(image); return(new SuccessResult(Messages.ImageDeleted)); }
public IResult Delete(CarImage carImage, IFormFile formFile) { var image = _carImageDal.Get(c => c.Id == carImage.Id); if (image == null) { return(new ErrorResult(Messages.ImageNotFound)); } ImageFileHelper.Delete(image.ImagePath); _carImageDal.Delete(carImage); return(new SuccessResult(Messages.İmageDeleted)); }
public IResult Delete(CarImage carImage) { IResult result = BusinessRules.Run( CheckIfImageExists(carImage.Id) ); if (result != null) { return(result); } string path = GetById(carImage.Id).Data.ImagePath; ImageFileHelper.Delete(path); _carImageDal.Delete(carImage); return(new SuccessResult()); }
public IResult Delete(CarImage carImage) { ImageFileHelper.Delete(carImage.ImagePath); _carImageDal.Delete(carImage); return(new SuccessResult()); }