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); } }
List group by
时间: 2024-11-09 01:48:30