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 void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteShipmentPackageDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); ShipmentPackagesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentPackageApplicationService.When(value as IDeleteShipmentPackage); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteShipmentPackageDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; ShipmentPackagesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentPackageApplicationService.When(value as IMergePatchShipmentPackage); return; } // /////////////////////////////// ShipmentPackagesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _shipmentPackageApplicationService.When(value as ICreateShipmentPackage); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }