C# List按某对象的属性分组 IGrouping

 DEMO: 
 var listTest = new List<RECORD_DETAIL>();
 listTest.Add(new RECORD_DETAIL { SYS_ID = 1, SYS_NO = "A" });
 listTest.Add(new RECORD_DETAIL { SYS_ID = 1, SYS_NO = "AA" });
 listTest.Add(new RECORD_DETAIL { SYS_ID = 2, SYS_NO = "B" });
 var modelsGroup = listTest.GroupBy(x => x.SYS_ID).ToList();
 IGrouping<int, RECORD_DETAIL> models = modelsGroup[0];
 int groupCount = models.Count<RECORD_DETAIL>();

C# List按某对象的属性分组 IGrouping

上一篇:MYSQL进阶学习笔记十一:MySQL 表的分析,检查和优化!(视频序号:进阶_28)


下一篇:C# PDF文件转图片