从另一个排除集合这是我喜欢的类型:由拉姆达
public class myType
{
public int Id { get; set; }
public string name { get; set; }
}
而且还有2集这种类型的:
List<myType> FristList= //fill ;
List<myType> Excludelist= //fill;
,我需要从FristList
类似下面的排除Excludelist
:
List<myType> targetList =
FirstList.Where(m=>m.Id not in (Excludelist.Select(t=>t.Id));
什么是你的建议关于确切的lambda快递上述查询的离子?
可能的重复[如何从另一个有效的C#中减去一个巨大的列表](http://stackoverflow.com/questions/5091922/how-to-subtract-one-huge-list-from-another-efficiently- in-c-sharp) – richardtallent 2012-03-17 07:26:30