/// <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)); } }
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))); }
public void DeleteProduct(string id) { _productRespository.DeleteProduct(id); }