C#从IEnumerable集合中删除重复的对象

era*_*zap 1 c# collections ienumerable

我有一个主要的IEnumerable集合,另一个较小的集合女巫包含一些重复的大集合,

   IEnumerable<T> all_objects ;
   IEnumerable<T> some_of_the_objects ;
Run Code Online (Sandbox Code Playgroud)

我正在寻找一种"更好看"的方法来从all_objects中删除some_of_the_objects中的所有对象,而不必遍历较小的集合

  foreach(T _object in some_of_the_objects)
  {
      all_objects.Remove(_object); 
  }
Run Code Online (Sandbox Code Playgroud)

Iva*_*lov 8

all_objects = all_objects.Except(some_of_the_objects);
Run Code Online (Sandbox Code Playgroud)