Exemplo n.º 1
0
        public IActionResult AddNewCarImage([FromForm(Name = ("Image"))] IFormFile file, [FromForm] CarImage carImage)
        {
            var result = _carImageService.AddImage(file, carImage);

            if (!result.Success)
            {
                return(BadRequest(result.Message));
            }
            return(Ok(Messages.Successful));
        }
Exemplo n.º 2
0
        public IActionResult AddImage([FromForm] IFormFile image, [FromForm] CarImage carImage)
        {
            var result = _carImageService.AddImage(image, carImage);

            if (result.Success)
            {
                return(StatusCode(201, result));
            }
            return(BadRequest(result));
        }
        public IActionResult AddImage([FromForm] IFormFile file, [FromForm] CarImage carImage)
        {
            var result = _carImageService.AddImage(file, carImage);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 4
0
        public IActionResult Add(CarImage image)
        {
            var result = _carImageService.AddImage(image);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemplo n.º 5
0
        public IActionResult Add([FromForm(Name = ("Image"))] IFormFile image, [FromForm(Name = ("Car"))] string car)
        {
            CarImage carImage = JsonConvert.DeserializeObject <CarImage>(car);
            var      result   = _carImageService.AddImage(carImage, image);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }