Exemple #1
0
        public static List <HighQualityListModel> QueryQuality()
        {
            List <QueryHighQualityList_Result> SpHighQualityList = new List <QueryHighQualityList_Result>();
            List <HighQualityListModel>        HighQualityList   = new List <HighQualityListModel>();

            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <QueryHighQualityList_Result, HighQualityListModel>();
            });

            IMapper iMapper = config.CreateMapper();

            using (StockEntities db = new StockEntities())
            {
                db.Database.ExecuteSqlCommand(" GenStockInfo @StockNum ", new SqlParameter("StockNum", ""));
                SpHighQualityList = db.QueryHighQualityList(0.05).ToList();
            }

            SpHighQualityList.ForEach(t =>
            {
                HighQualityListModel r = iMapper.Map <QueryHighQualityList_Result, HighQualityListModel>(t);
                HighQualityList.Add(r);
            });

            LogHelper.doLog("StableStockServices_QueryQuality", JsonConvert.SerializeObject(HighQualityList));
            return(HighQualityList);
        }