C# Compare Lists with custom object but ignore order
问题 I'm trying to compare 2 Lists (wrapped in an object) containing custom objects. I don't care about the order, but if list 1 contains "1,2,3,4" then list 2 must and only contain those elements. E.g.: "4,2,3,1" Based on Compare two List<T> objects for equality, ignoring order ignoring-order I've used the Except and Any but it doesn't give me the desired results. If I use Assert.Equals it fails, but Assert.IsTry(list1.equals(list2)) succeeds. Further more if I remove the Equals and GetHashCode