public static bool InsertProductURL(bool isFull = false) { List <string> productUrlList = new List <string>(); IEnumerable <Product> products = BaseDataDAL.GetProducts(isFull); if (products != null && products.Any()) { foreach (var product in products.Where(q => q != null)) { productUrlList.Add(string.Format("http://item.tuhu.cn/Products{0}{1}.html", !string.IsNullOrWhiteSpace(product.ProductID) ? "/" + product.ProductID : string.Empty, !string.IsNullOrWhiteSpace(product.VariantID) ? "/" + product.VariantID : string.Empty)); } } WeeklySitemapJob.Logger.Info("有" + productUrlList.Count() + "需要导入库"); return(InsertURLToDB(productUrlList, "Product")); }