public IResult Add(IFormFile file, CarImage carImage) { IResult result = BusinessBules.Run(CheckImageLimit(carImage.CarId)); if (result != null) { return(result); } carImage.ImagePath = FileHelper.Add(file); carImage.Date = DateTime.Now; _carImageDal.Add(carImage); return(new SuccessResult()); }
public IResult Update(IFormFile file, CarImage carImage) { IResult result = BusinessBules.Run(CheckImageLimit(carImage.CarId)); if (result != null) { return(result); } carImage.ImagePath = FileHelper.Update(_carImageDal.Get(c => c.CarImageId == carImage.CarImageId).ImagePath, file); carImage.Date = DateTime.Now; _carImageDal.Update(carImage); return(new SuccessResult()); }