Пример #1
0
        public async Task <IActionResult> Delete([FromRoute] int productImageId)
        {
            var productImage = await _productImageService.GetByIdAsync(productImageId);

            if (productImage == null)
            {
                return(NotFound());
            }

            var isDeleted = await _productImageService.DeleteAsync(productImage);

            if (!isDeleted)
            {
                return(BadRequest("Xoá hình ảnh không thành công"));
            }

            return(NoContent());
        }
        public async Task <IActionResult> Delete(int id, ProductModel productModel)
        {
            await productImageService.DeleteAsync(this.WebsiteId, id, productModel);

            return(Ok(new ApiResponse <ProductModel>()));
        }