public void Patch(string id, [FromBody] MergePatchProductCategoryDto value) { try { ProductCategoriesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _productCategoryApplicationService.When(value as IMergePatchProductCategory); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Delete(string id, string commandId, string version, string requesterId = default(string)) { try { var value = new DeleteProductCategoryDto(); value.CommandId = commandId; value.RequesterId = requesterId; value.Version = (long)Convert.ChangeType(version, typeof(long)); ProductCategoriesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _productCategoryApplicationService.When(value as IDeleteProductCategory); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }
public void Put(string id, [FromBody] CreateOrMergePatchOrDeleteProductCategoryDto value) { try { // /////////////////////////////// if (value.Version != default(long)) { value.CommandType = CommandType.MergePatch; ProductCategoriesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _productCategoryApplicationService.When(value as IMergePatchProductCategory); return; } // /////////////////////////////// ProductCategoriesControllerUtils.SetNullIdOrThrowOnInconsistentIds(id, value); _productCategoryApplicationService.When(value as ICreateProductCategory); } catch (Exception ex) { var response = HttpServiceExceptionUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); } }