コード例 #1
0
        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());
        }
コード例 #2
0
        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());
        }