I used the following 2 linq queries to check if two list are have exactly same contents(the type of list doesn't matter, assume List of string)
bool haveSameContents = list1.All(x=>list2.Any(y=>y==x)) && list2.All(x=>list1.Any(y=>y==x))
//OR
bool haveSameContents = !( list1.Any(x=>list2.All(y=>y!=x)) || list2.Any(x=>list1.All(y=>y!=x)) )