Filtering lists using LINQ

前端 未结 9 2072
暖寄归人
暖寄归人 2021-02-04 00:23

I\'ve got a list of People that are returned from an external app and I\'m creating an exclusion list in my local app to give me the option of manually removing people from the

9条回答
  •  遇见更好的自我
    2021-02-04 00:37

    Many thanks for this guys.

    I mangaged to get this down to one line:

      var results = from p in People 
                    where !(from e in exclusions 
                            select e.CompositeKey).Contains(p.CompositeKey) 
                    select p;
    

    Thanks again everyone.

提交回复
热议问题