예제 #1
0
 public void Patch(string id, [FromBody] MergePatchPicklistItemMvoDto value)
 {
     try {
         PicklistItemMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _picklistItemMvoApplicationService.When(value as IMergePatchPicklistItemMvo);
     } catch (Exception ex) { var response = PicklistItemMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
예제 #2
0
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeletePicklistItemMvoDto();
         value.CommandId          = commandId;
         value.RequesterId        = requesterId;
         value.PicklistBinVersion = (long)Convert.ChangeType(version, typeof(long));
         PicklistItemMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _picklistItemMvoApplicationService.When(value as IDeletePicklistItemMvo);
     } catch (Exception ex) { var response = PicklistItemMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
예제 #3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeletePicklistItemMvoDto value)
        {
            try {
                // ///////////////////////////////
                if (value.PicklistBinVersion != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    PicklistItemMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _picklistItemMvoApplicationService.When(value as IMergePatchPicklistItemMvo);
                    return;
                }
                // ///////////////////////////////

                PicklistItemMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _picklistItemMvoApplicationService.When(value as ICreatePicklistItemMvo);
            } catch (Exception ex) { var response = PicklistItemMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }