예제 #1
0
 public void Patch(string id, [FromBody] MergePatchDocumentTypeDto value)
 {
     try {
         DocumentTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _documentTypeApplicationService.When(value as IMergePatchDocumentType);
     } 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 DeleteDocumentTypeDto();
         value.CommandId   = commandId;
         value.RequesterId = requesterId;
         value.Version     = (long)Convert.ChangeType(version, typeof(long));
         DocumentTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _documentTypeApplicationService.When(value as IDeleteDocumentType);
     } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
예제 #3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteDocumentTypeDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    DocumentTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _documentTypeApplicationService.When(value as IMergePatchDocumentType);
                    return;
                }
                // ///////////////////////////////

                DocumentTypesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _documentTypeApplicationService.When(value as ICreateDocumentType);
            } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }