1
2
3
4
5
6
7
8 |
StringBuilder sb = new
StringBuilder(); List<IGrouping< string , modle>> listRepeat = modelList.GroupBy(l => l.IDCode).Where(g => g.Count() > 1).ToList(); if
(listRepeat.Count() > 0) { foreach
(IGrouping< string , modle> data in
listRepeat) sb.AppendFormat( "您输入了相同的身份证号/组织机构代码\\\"{0}\\\"!\\r\\n" , data.Key); } |
Linq使用GroupBy筛选数据,布布扣,bubuko.com
原文:http://www.cnblogs.com/dashi/p/3680503.html