List<int> myPrimes = new List<int> { 2, 3, 5, 7, 11, 13, 17 };
List<int> yourPrimes = new List<int> { 2, 3, 5, 7, 11, 13, 17 };
// == and Equals : reference equality
bool compare = (myPrimes == yourPrimes); // false
compare = myPrimes.Equals(yourPrimes); // false
If you want to compare two lists by comparing the values of the objects in the list, you can use the SequenceEqual method provide by System.Linq.
// SequenceEquals method : value equality
compare = myPrimes.SequenceEqual(yourPrimes); // true
List<int> dougsPrimes = new List<int> { 2, 3, 5, 7, 11, 13, 19 }; // oops
compare = yourPrimes.SequenceEqual(dougsPrimes); // false