public void Patch(string id, [FromBody] MergePatchMovementConfirmationDto value) { try { MovementConfirmationsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _movementConfirmationApplicationService.When(value as IMergePatchMovementConfirmation); } catch (Exception ex) { var response = MovementConfirmationsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteMovementConfirmationDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); MovementConfirmationsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _movementConfirmationApplicationService.When(value as IDeleteMovementConfirmation); } catch (Exception ex) { var response = MovementConfirmationsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteMovementConfirmationDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; MovementConfirmationsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _movementConfirmationApplicationService.When(value as IMergePatchMovementConfirmation); return; } // /////////////////////////////// MovementConfirmationsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _movementConfirmationApplicationService.When(value as ICreateMovementConfirmation); } catch (Exception ex) { var response = MovementConfirmationsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }