.net中除去IList中的多余项

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  为过滤后存入的值

你可能感兴趣的:(.net)