I have two Generic Dictionaries.Both have same keys.But values can be different.I want to compare 2nd dictionary with 1st dictionary .If there are differences between values
var diff1 = d1.Except(d2); var diff2 = d2.Except(d1); return diff1.Concat(diff2);
Edit: If you sure all keys are same you can do:
var diff = d2.Where(x=>x.Value != d1[x.Key]).ToDictionary(x=>x.Key, x=>x.Value);