linq進行list分組匯總
1 var yield_day = (from item in yield 2 group item by new 3 { 4 item.DEFECTITEM, 5 item.CDAY 6 } 7 into g 8 select new 9 { 10 cday = g.Key.CDAY, 11 item = g.Key.DEFECTITEM, 12 cnt = g.Count() 13 }).OrderBy(g => g.cday).ThenBy(g => g.item).ToList();