public async Task <string> MineProduct(string url) { string pageContent = await HttpTools.DownloadPage(url); //get wallmart product details Product product = ExtractProduct(pageContent); BaseDataAccess bda = new BaseDataAccess(); int productId = 0; if (!bda.ProductExists(product.SellerInternalId, out productId)) { productId = (int)bda.AddProduct(product); if (productId > 0) { foreach (Review r in product.Reviews) { bda.AddReview(productId, r); } } } else { bda.DeleteReviews(productId); //refill reviews foreach (Review r in product.Reviews) { bda.AddReview(productId, r); } } return(product.SellerInternalId); }