public void Patch(string id, [FromBody] MergePatchShipmentPackageDto value) { try { ShipmentPackagesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentPackageApplicationService.When(value as IMergePatchShipmentPackage); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public async Task WhenAsync(MergePatchShipmentPackageDto c) { var idObj = ShipmentPackageProxyUtils.ToIdString((c as IMergePatchShipmentPackage).ShipmentPackageId); var uriParameters = new ShipmentPackageUriParameters(); uriParameters.Id = idObj; var req = new ShipmentPackagePatchRequest(uriParameters, (MergePatchShipmentPackageDto)c); var resp = await _ramlClient.ShipmentPackage.Patch(req); ShipmentPackageProxyUtils.ThrowOnHttpResponseError(resp); }
public void When(MergePatchShipmentPackageDto c) { WhenAsync(c).GetAwaiter().GetResult(); }