我有一个主要的IEnumerable集合,
另一个较小的收藏女巫包含了较大的收藏中的一些副本,
IEnumerable<T> all_objects ;
IEnumerable<T> some_of_the_objects ;
我正在寻找一种“更好看”的方式来从some_of_the_objects中删除所有对象
来自all_objects,而不必遍历较小的集合
foreach(T _object in some_of_the_objects)
{
all_objects.Remove(_object);
}
请您参考如下方法:
all_objects = all_objects.Except(some_of_the_objects);
