I recently came across some amazing Tuple behavior on the list. The list box seems to make a different comparison than what I expected. Can someone explain the difference?
Tuple<int,int> A = new Tuple<int, int>(5,5);
Tuple<int, int> B = new Tuple<int, int>(5, 5);
List<Tuple<int,int>> AList = new List<Tuple<int, int>>() {A};
bool C = AList.Contains(B);
bool D = A == B;
Edit 1: To specify a duplicate flag. I knew that == and .Equals were different functions, the amazing thing here is the concrete implementation in the List.Contains function.
source
share