public IResult Update(IFormFile file, CarImage carImage) { carImage.ImagePath = ImageFileHelper.Update(_carImageDal.Get(p => p.Id == carImage.Id).ImagePath, file); carImage.Date = DateTime.Now; _carImageDal.Update(carImage); return(new SuccessResult()); }
public IResult Update(CarImage carImage, IFormFile formFile) { var uimage = (_carImageDal.Get(i => i.Id == carImage.Id).ImagePath); carImage.ImagePath = ImageFileHelper.Update(uimage, formFile); carImage.Date = DateTime.Now; _carImageDal.Update(carImage); return(new SuccessResult(Messages.ImageUpdated)); }
public IResult Update(IFormFile file, Image image) { IResult result = BusinessRules.Run(CheckIfImageLimitBorder(image.CarId)); if (result != null) { return(result); } var result1 = _imageDal.Get(c => c.ImageId == image.ImageId); image.ImagePath = ImageFileHelper.Update(file, result1.ImagePath); image.Date = DateTime.Now; _imageDal.Update(image); return(new SuccessResult(Messages.ImageUpdated)); }
public IResult Update(CarImage carImage, IFormFile file) { IResult result = BusinessRules.Run( CheckIfImageLimitExpired(carImage.CarId), CheckIfImageExtensionValid(file), CheckIfImageExists(carImage.Id) ); if (result != null) { return(result); } CarImage OldData = GetById(carImage.Id).Data; carImage.ImagePath = ImageFileHelper.Update(file, OldData.ImagePath); carImage.Date = DateTime.Now; carImage.CarId = OldData.CarId; _carImageDal.Update(carImage); return(new SuccessResult()); }