public async Task <IActionResult> GetImageById(int productId, int imageId)
        {
            var result = await _productImageService.GetImageById(imageId);

            if (result.IsSuccessed == false)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteProductImage(int id)
        {
            var modelFromRepo = _imageService.GetImageById(id);

            if (modelFromRepo == null)
            {
                return(NotFound());
            }
            _imageService.DeleteProductImage(modelFromRepo);
            _imageService.SaveChanges();
            return(NoContent());
        }