public async Task <bool> DeleteOneProduct(int id) { try { //var filter = Builders<Product>.Filter.Eq("ProdId", id); //var result = _mongoRepo.product.Find(filter).FirstOrDefaultAsync(); //var result = _productRepo.GetProductById(id); //if (result.Result == null) //{ // return false; //} //else //{ // //await _mongoRepo.product.DeleteOneAsync(filter); return(await _productRepo.DeleteOneProduct(id)); // return true; //} } catch (Exception ex) { throw ex; } }
public async Task <bool> DeleteOneProduct(int id) { return(await _productRepo.DeleteOneProduct(id)); }