• 周六. 4月 20th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

.net中除去IList中的多余项

admin

11月 28, 2021

1 IList<ActionInfo> tempList = new List<ActionInfo>();
2  IList<ActionInfo> tempActionList = new List<ActionInfo>();
3 
4   var iactionlist = (from li in tempList
5                                select li).Distinct();
6             foreach (var d in iactionlist)
7             {
8                 tempActionList.Add(d);
9             } 

View Code

tempList  为首次取出的值,tempActionList  为过滤后存入的值

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注