public async Task WhenAsync(MergePatchProductDto c) { var idObj = (c as IMergePatchProduct).ProductId; var uriParameters = new ProductUriParameters(); uriParameters.Id = idObj; var req = new ProductPatchRequest(uriParameters, (MergePatchProductDto)c); var resp = await _ramlClient.Product.Patch(req); ProductProxyUtils.ThrowOnHttpResponseError(resp); }
public ActionResult PartialUpdateProduct(int id, [FromBody] ProductPatchRequest patchRequest) { if (patchRequest == null) { return(BadRequest("Product patch request cannot be null")); } var updateProductResult = productManager.UpdateProduct(id, new ProductUpdateParameters() { Description = patchRequest.Description, ReplaceDescription = true }); if (!updateProductResult.Success) { return(BadRequest(updateProductResult.ExceptionMessage)); } return(Ok(updateProductResult.Result)); }