public void Patch(string id, [FromBody] MergePatchProductDto value) { try { ProductsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _productApplicationService.When(value as IMergePatchProduct); } catch (Exception ex) { var response = ProductsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
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 void When(MergePatchProductDto c) { WhenAsync(c).GetAwaiter().GetResult(); }