Exemplo n.º 1
0
 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 async Task WhenAsync(DeleteProductCategoryDto c)
        {
            var idObj         = (c as IDeleteProductCategory).ProductCategoryId;
            var uriParameters = new ProductCategoryUriParameters();

            uriParameters.Id = idObj;

            var q = new ProductCategoryDeleteQuery();

            q.CommandId   = c.CommandId;
            q.RequesterId = c.RequesterId;
            q.Version     = Convert.ToString(c.Version);

            var req = new ProductCategoryDeleteRequest(uriParameters);

            req.Query = q;

            var resp = await _ramlClient.ProductCategory.Delete(req);

            ProductCategoryProxyUtils.ThrowOnHttpResponseError(resp);
        }
 public void When(DeleteProductCategoryDto c)
 {
     WhenAsync(c).GetAwaiter().GetResult();
 }