C# more efficient way of comparing two collections

Viewed 19178

I have two collections

List<Car> currentCars = GetCurrentCars();
List<Car> newCars = GetNewCars();

I don't want to use foreach loop or something because i think there should be much better way of doing this.

I am looking for more efficient way to compare this collections and to get results:

  1. List of cars which are in newCars and not in currentCars
  2. List of cars which are not in newCars and in currentCars

Type Car has int property Id.

There was an answer, which is already deleted saying What i mean by saying efficient: less code, less mechanics, and more readable cases

So thinking this way what is the cases i have?

What would be less code, less mechanics, and more readable cases?

8 Answers
Related