I'm comparing two lists to see if one contains a value from the other and vice-versa:
List<customer> NotOnLocal =
AllServer.Where(p => !AllLocal.Any(p2 => p2.Reference == p.customerNumber))
.ToList();
List<ConnectCustomer> NotOnServer =
AllLocal.Where(p => !AllServer.Any(p2 => p2.customerNumber == p.Reference))
.ToList();
This seems to work fine but with over 100,000 objects in each the comparison gets a little slow. Does anyone know if there is a more efficient way to make the comparison and return the respective lists?