I have two lists:
List<User> collection1 = new List<User>();
List<User> collection2 = new List<User>();
1) I have to get all items common to both of the lists using LINQ. However, the class User
has a lot of properties and I just want to compare FirstName
and LastName
.
2) How can I get the items in collection1
but not in collection2
using the same comparison rule?