コード例 #1
0
ファイル: PartyRolesController.cs プロジェクト: windygu/wms-2
 public void Patch(string id, [FromBody] MergePatchPartyRoleDto value)
 {
     try {
         PartyRolesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _partyRoleApplicationService.When(value as IMergePatchPartyRole);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
コード例 #2
0
ファイル: PartyRolesController.cs プロジェクト: windygu/wms-2
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeletePartyRoleDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         PartyRolesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _partyRoleApplicationService.When(value as IDeletePartyRole);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
コード例 #3
0
ファイル: PartyRolesController.cs プロジェクト: windygu/wms-2
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeletePartyRoleDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    PartyRolesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _partyRoleApplicationService.When(value as IMergePatchPartyRole);
                    return;
                }
                // ///////////////////////////////

                PartyRolesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _partyRoleApplicationService.When(value as ICreatePartyRole);
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }