【发布时间】:2012-10-24 18:47:59
【问题描述】:
我创建了一个两个 int 类型的列表,并使用 except 方法将仅在 list1 中的项目分配给 list1。例如
List<int> list1 = new List<int>();
List<int> list2 = new List<int>();
list1 = {1,2,3,4,5,6} // get items from the database
list2 = {3,5,6,7,8} // get items from the database
list1 = list1.Except(list2); // gives me an error.
请给我建议。正确的做法是什么。
【问题讨论】:
标签: c# .net list ienumerable