public void Patch(string id, [FromBody] MergePatchShipmentDto value) { try { ShipmentsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentApplicationService.When(value as IMergePatchShipment); } catch (Exception ex) { var response = ShipmentsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(MergePatchShipmentDto c) { var idObj = (c as IMergePatchShipment).ShipmentId; var uriParameters = new ShipmentUriParameters(); uriParameters.Id = idObj; var req = new ShipmentPatchRequest(uriParameters, (MergePatchShipmentDto)c); var resp = await _ramlClient.Shipment.Patch(req); ShipmentProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(MergePatchShipmentDto c) { WhenAsync(c).GetAwaiter().GetResult(); }