Beispiel #1
0
 public void Patch(string id, [FromBody] MergePatchProductDto value)
 {
     try {
         ProductsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _productApplicationService.When(value as IMergePatchProduct);
     } catch (Exception ex) { var response = ProductsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Beispiel #2
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteProductDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    ProductsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _productApplicationService.When(value as IMergePatchProduct);
                    return;
                }
                // ///////////////////////////////

                ProductsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _productApplicationService.When(value as ICreateProduct);
            } catch (Exception ex) { var response = ProductsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }