private void Init() { QueryThirdPartInventoryEntity QueryThirdPart = new QueryThirdPartInventoryEntity(InventoryQtyBiz.QueryProduct); QueryTaobaoProduct QueryTaobao = new QueryTaobaoProduct(SynInventoryQtyBiz.QuerySynProduct); IAsyncResult thirdPartResult = QueryThirdPart.BeginInvoke(null, null); IAsyncResult taobaoResult = QueryTaobao.BeginInvoke(null, null); ThirdPartInventoryEntityList = QueryThirdPart.EndInvoke(thirdPartResult); TaobaoProductList = QueryTaobao.EndInvoke(taobaoResult); }
public static List <TaobaoProduct> QuerySynProduct() { IEnumerable <TaobaoProduct> list = new List <TaobaoProduct>(); QueryTaobaoProduct QueryInventory = new QueryTaobaoProduct(TaoBaoService.QueryInventory); QueryTaobaoProduct QueryOnSale = new QueryTaobaoProduct(TaoBaoService.QueryOnSale); IAsyncResult QueryOnSale_Result = QueryOnSale.BeginInvoke(null, null); IAsyncResult QueryInventory_Result = QueryInventory.BeginInvoke(null, null); List <TaobaoProduct> inventory_result = QueryInventory.EndInvoke(QueryInventory_Result); List <TaobaoProduct> onsale_result = QueryOnSale.EndInvoke(QueryOnSale_Result); list = list.Union(inventory_result); list = list.Union(onsale_result); IEqualityComparer <TaobaoProduct> compare = new TaobaoProductCompare(); return(list.Distinct(compare).ToList()); }