如何将这两位代码转换为一位?
comCtrList = (from i in genOutList
join f in genAccList
on i.Contract equals f.Contract
select i.Contract).ToList();
genOutList.RemoveAll(acc => comCtrList.Contains(acc.Contract));
答案 0 :(得分:0)
你想要这样的东西吗?
genOutList= (
from i in genOutList
where !genAccList.Any(x=>x.Contract==i.Contract)
select i
).ToList();
或者
genOutList.RemoveAll(x=>genAccList.Any(i=>i.Contract==x.Contract));