Пример #1
0
 public void Patch(string id, [FromBody] MergePatchPicklistBinDto value)
 {
     try {
         PicklistBinsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _picklistBinApplicationService.When(value as IMergePatchPicklistBin);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.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 DeletePicklistBinDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         PicklistBinsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _picklistBinApplicationService.When(value as IDeletePicklistBin);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Пример #3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeletePicklistBinDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    PicklistBinsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _picklistBinApplicationService.When(value as IMergePatchPicklistBin);
                    return;
                }
                // ///////////////////////////////

                PicklistBinsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _picklistBinApplicationService.When(value as ICreatePicklistBin);
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }