select from list where not in other list c#

124

select from list where not in other list c# -

var result = peopleList2.Where(p => peopleList1.All(p2 => p2.ID != p.ID));

select from list where not in other list c# -

var result = peopleList2.Where(p => !peopleList1.Any(p2 => p2.ID == p.ID));

Comments

Submit
0 Comments