Exemplo n.º 1
0
 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); }
 }
Exemplo n.º 2
0
 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); }
 }
Exemplo n.º 3
0
        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); }
        }