public void Patch(string id, [FromBody] MergePatchShipmentPackageContentMvoDto value) { try { ShipmentPackageContentMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentPackageContentMvoApplicationService.When(value as IMergePatchShipmentPackageContentMvo); } catch (Exception ex) { var response = ShipmentPackageContentMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteShipmentPackageContentMvoDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.ShipmentPackageVersion = (long)Convert.ChangeType(version, typeof(long)); ShipmentPackageContentMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentPackageContentMvoApplicationService.When(value as IDeleteShipmentPackageContentMvo); } catch (Exception ex) { var response = ShipmentPackageContentMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteShipmentPackageContentMvoDto value) { try { // /////////////////////////////// if (value.ShipmentPackageVersion != default(long)) { value.CommandType = CommandType.MergePatch; ShipmentPackageContentMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentPackageContentMvoApplicationService.When(value as IMergePatchShipmentPackageContentMvo); return; } // /////////////////////////////// ShipmentPackageContentMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentPackageContentMvoApplicationService.When(value as ICreateShipmentPackageContentMvo); } catch (Exception ex) { var response = ShipmentPackageContentMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }