首页 > 代码库 > List group by

List group by

            var newList = from w in oldList group w by new {w.vCode, w.vName,w.vNo } into g select new { g.Key, g };            int listcount = newList .Count();            foreach (var item in newList )            {                string code= item.Key.vCode;                string no= item.Key.vNo ;                string name= item.Key.vName;                if (!string.IsNullOrEmpty(vCode))                {                    List<StockApply> stockApplyGroupList = stockApplyList.Where(s => s.vCode== code&& s.vNo == no&& s.vName== name).ToList();                    secDeptPlanServiceBLL.SplitStockApply(stockApplyGroupList);                }            }