コード例 #1
0
        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;
            }
        }
コード例 #2
0
 public async Task <bool> DeleteOneProduct(int id)
 {
     return(await _productRepo.DeleteOneProduct(id));
 }