public void Patch(string id, [FromBody] MergePatchRejectionReasonDto value) { try { RejectionReasonsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _rejectionReasonApplicationService.When(value as IMergePatchRejectionReason); } catch (Exception ex) { var response = RejectionReasonsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteRejectionReasonDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); RejectionReasonsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _rejectionReasonApplicationService.When(value as IDeleteRejectionReason); } catch (Exception ex) { var response = RejectionReasonsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteRejectionReasonDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; RejectionReasonsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _rejectionReasonApplicationService.When(value as IMergePatchRejectionReason); return; } // /////////////////////////////// RejectionReasonsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _rejectionReasonApplicationService.When(value as ICreateRejectionReason); } catch (Exception ex) { var response = RejectionReasonsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }