Answers for "Use LINQ to get items in one List<>, that are not in another List<>"

1

Use LINQ to get items in one List<>, that are not in another List<>

var result = peopleList2.Where(p => !peopleList1.Any(p2 => p2.ID == p.ID));
Posted by: Guest on April-13-2021
0

Use LINQ to get items in one List<>, that are not in another List<>

var result = peopleList2.Where(p => peopleList1.All(p2 => p2.ID != p.ID));
Posted by: Guest on April-13-2021

Code answers related to "Use LINQ to get items in one List<>, that are not in another List<>"

Browse Popular Code Answers by Language