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 void Put(string id, [FromBody] CreateOrMergePatchOrDeleteShipmentDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; ShipmentsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentApplicationService.When(value as IMergePatchShipment); return; } // /////////////////////////////// ShipmentsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentApplicationService.When(value as ICreateShipment); } catch (Exception ex) { var response = ShipmentsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }