public IResult UpdateImage(IFormFile file, CarImages carImages) { carImages.ImagePath = FileHelper.Update(_ICarImagesDAL.Get(i => i.CarId == carImages.CarId).ImagePath, file); carImages.Date = DateTime.Now; _ICarImagesDAL.Update(carImages); return(new SuccessResult()); }
public IResult Update(IFormFile file, CarImages carImage) { IResult result = BusinessRules.Run( CheckIfImageCountLimit(carImage.CarId) ); if (result != null) { return(result); } carImage.ImagePath = FileHelper.Update(_carImageDal.Get(p => p.Id == carImage.Id).ImagePath, file); carImage.Date = DateTime.Now; _carImageDal.Update(carImage); return(new SuccessResult()); }