我有2个IEnumerable集合.
IEnumerable<MyClass> objectsToExcept
Run Code Online (Sandbox Code Playgroud)
和
IEnumerable<MyClass> allObjects.
Run Code Online (Sandbox Code Playgroud)
objectsToExcept可能包含来自的对象allObjects.
我需要从中删除allObjects对象objectsToExcept.例如:
foreach (var myClass in objectsToExcept)
{
allObjects.Remove(myClass);
}
Run Code Online (Sandbox Code Playgroud)
要么
allObject.Except(objectsToExcept)
Run Code Online (Sandbox Code Playgroud)
但它不起作用.方法执行后的计数表示没有删除任何项目.
我有一个这样的调查员
IEnumerable<System.Windows.Documents.FixedPage> page;
Run Code Online (Sandbox Code Playgroud)
如何添加页面(例如:D:\newfile.txt)?我已经试过Add,Append,Concat等但没有为我工作.