public void Patch(string id, [FromBody] MergePatchAttributeValueMvoDto value)
 {
     try {
         AttributeValueMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _attributeValueMvoApplicationService.When(value as IMergePatchAttributeValueMvo);
     } catch (Exception ex) { var response = AttributeValueMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
 public void Delete(string id, string commandId, string version, string requesterId = default(string))
 {
     try {
         var value = new DeleteAttributeValueMvoDto();
         value.CommandId        = commandId;
         value.RequesterId      = requesterId;
         value.AttributeVersion = (long)Convert.ChangeType(version, typeof(long));
         AttributeValueMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _attributeValueMvoApplicationService.When(value as IDeleteAttributeValueMvo);
     } catch (Exception ex) { var response = AttributeValueMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
예제 #3
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteAttributeValueMvoDto value)
        {
            try {
                // ///////////////////////////////
                if (value.AttributeVersion != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    AttributeValueMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _attributeValueMvoApplicationService.When(value as IMergePatchAttributeValueMvo);
                    return;
                }
                // ///////////////////////////////

                AttributeValueMvosControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _attributeValueMvoApplicationService.When(value as ICreateAttributeValueMvo);
            } catch (Exception ex) { var response = AttributeValueMvosControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }