Remove items from IEnumerable

后端 未结 4 733
醉话见心
醉话见心 2021-01-31 14:25

I have 2 IEnumerable collections.

IEnumerable objectsToExcept 

and

IEnumerable allObjects.
         


        
4条回答
  •  旧时难觅i
    2021-01-31 15:12

    Remove and Except do not modify the original IEnumerable. They return a new one. try

    var result = allObject.Except(objectsToexcept);
    

提交回复
热议问题