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

posted @ 2013-12-05 17:43  笨笨的菜鸟  阅读(182)  评论(0)    收藏  举报