public async Task <IActionResult> DeleteProduct(int?postId) { int result = 0; if (postId == null) { return(BadRequest()); } try { result = await _ProductRepositories1.DeleteProduct(postId); if (result == 0) { return(NotFound()); } return(Ok()); } catch (Exception) { return(BadRequest()); } }