Esempio n. 1
0
        public IActionResult DeleteProductImageProduct([FromBody] ProductImageProductDTO request)
        {
            var response = new OperationResponse <ICollection>();

            try
            {
                var result = _productImageService.DeleteProductImage_Product_dyId(request.Tasks);
                if (result.Any(fn => !string.IsNullOrEmpty(fn.Message)))
                {
                    response.State = ResponseState.ValidationError;
                    response.Data  = result.ToList();
                    return(new JsonResult(response));
                }
                else
                {
                    response.State = ResponseState.Success;
                }
            }
            catch (Exception exception)
            {
                response.State = ResponseState.Error;
                response.Messages.Add(exception.Message);
                _logger.LogError(exception, "Error in DeleteProduct ==>" + exception.StackTrace, request);
            }
            return(new JsonResult(response));
        }