Esempio n. 1
0
 public void Patch(string id, [FromBody] MergePatchPicklistDto value)
 {
     try {
         PicklistsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _picklistApplicationService.When(value as IMergePatchPicklist);
     } catch (Exception ex) { var response = PicklistsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Esempio n. 2
0
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeletePicklistDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         PicklistsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _picklistApplicationService.When(value as IDeletePicklist);
     } catch (Exception ex) { var response = PicklistsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Esempio n. 3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeletePicklistDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    PicklistsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _picklistApplicationService.When(value as IMergePatchPicklist);
                    return;
                }
                // ///////////////////////////////

                PicklistsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _picklistApplicationService.When(value as ICreatePicklist);
            } catch (Exception ex) { var response = PicklistsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }