Exemple #1
0
 public void Patch(string id, [FromBody] MergePatchSupplierProductDto value)
 {
     try {
         SupplierProductsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
         _supplierProductApplicationService.When(value as IMergePatchSupplierProduct);
     } catch (Exception ex) { var response = SupplierProductsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }
Exemple #2
0
        public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteSupplierProductDto value)
        {
            try {
                // ///////////////////////////////
                if (value.Version != default(long))
                {
                    value.CommandType = CommandType.MergePatch;
                    SupplierProductsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                    _supplierProductApplicationService.When(value as IMergePatchSupplierProduct);
                    return;
                }
                // ///////////////////////////////

                SupplierProductsControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value);
                _supplierProductApplicationService.When(value as ICreateSupplierProduct);
            } catch (Exception ex) { var response = SupplierProductsControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
        }