示例#1
0
 public void Patch(string id, [FromBody] MergePatchStatusItemDto value)
 {
     try {
         StatusItemsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _statusItemApplicationService.When(value as IMergePatchStatusItem);
     } catch (Exception ex) { var response = StatusItemsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
示例#2
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteStatusItemDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    StatusItemsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _statusItemApplicationService.When(value as IMergePatchStatusItem);
                    return;
                }
                // ///////////////////////////////

                StatusItemsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _statusItemApplicationService.When(value as ICreateStatusItem);
            } catch (Exception ex) { var response = StatusItemsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }