Пример #1
0
 /// <summary>Deletes the specified product identifier.</summary>
 /// <param name="productID">The product identifier.</param>
 public JsonResult DeleteProduct(int productID)
 {
     try
     {
         var response = _productRepository.DeleteProduct(productID);
         return(Json(response));
     }
     catch (Exception e)
     {
         return(Json(false));
     }
 }
Пример #2
0
        public ProductResponse DeleteProduct(ProductReadRequest productReques)
        {
            ProductResponse productResponse = new ProductResponse();

            try
            {
                IproductR.DeleteProduct(productReques.IdProduct);
                productResponse.Success = true;
            }
            catch (Exception e)
            {
                productResponse.Exception = e;
                productResponse.Success   = false;
            }
            return(productResponse);
        }
 public async Task <IActionResult> DeleteProduct(string productId)
 {
     return(Ok(await _productRespository.DeleteProduct(productId)));
 }
Пример #4
0
 public void DeleteProduct(string id)
 {
     _productRespository.DeleteProduct(id);
 }