[Solved] How to compare list values in a dictionary


If you want to compare keys of Dictionary, then:

var dict1 = new Dictionary<string, List<string>>();
var dict2 = new Dictionary<string, List<string>>();
// something..
if (dict1.Keys.SequenceEqual(dict2.Keys)) 
{
  // your code
}

If you want to compare values of Dictionary, then:

var dict1 = new Dictionary<string, List<string>>();
var dict2 = new Dictionary<string, List<string>>();
// something..
var d1Keys = dict1.Keys.ToList();
var result = d1Keys
    .All(key => dict2.ContainsKey(key) && dict1[key].SequenceEqual(dict2[key]));
// result == true, if equals

solved How to compare list values in a dictionary