Esempio n. 1
0
        public static List <SkuProductDetailModel> GetProductDetailModelList()
        {
            IEnumerable <string> pids = BaseDataDAL.GetPIDList();

            List <SkuProductDetailModel> productdetailList = new List <SkuProductDetailModel>();

            if (pids != null && pids.Any())
            {
                using (var client = new ProductClient())
                {
                    int           count   = pids.Count() / 100;
                    List <string> pidList = new List <string>();
                    for (int i = 0; i <= count; i++)
                    {
                        pidList = pids.Skip(i * 100).Take(100).ToList();

                        var response = client.SelectSkuProductListByPids(pidList);
                        if (response != null && response.Result != null)
                        {
                            productdetailList.AddRange(response.Result);
                        }
                    }
                }
            }
            return(productdetailList);
        }