Dapper Query和IList

Dapper Query和IList

 

public GoodDM GetDMGoods(int GoodsID, int BID)

        {

            GoodDM entity = new GoodDM();

            var entity_Goods = bllGoods.GetGoodsDetail(GoodsID, BID);

            if (entity_Goods != null && entity_Goods.GoodsID != 0)

            {

                entity.Detaile = entity_Goods;

                IList<TM.SOA.Entity.DM.DM> Goods_DMList = new List<TM.SOA.Entity.DM.DM>();

                Goods_DMList = GetDMListByGoods(BID,GoodsID,true);//查询得到的过滤过期的DM

                var MiaoShaList = Goods_DMList.Where(p => p.Type == (int)DMEnum.miao).ToList();

                if (MiaoShaList != null && MiaoShaList.Count > 0)

                {//如果商品存在秒杀,直接返回秒杀

                    entity.IsMiao = true;

                    entity.DMList = MiaoShaList;

                    return entity;

                }

                entity.DMList = Goods_DMList;

            }

            entity.IsMiao = false;

            return entity;

        }

 

 

posted on 2022-09-20 16:12  Jankie1122  阅读(20)  评论(0编辑  收藏  举报