Using C#, I want to compare two dictionaries to be specific, two dictionaries with the same keys but not same values, I found a method Comparer but I’m not quite sure how can I use it? Is there a way other than iterating through each key?
Dictionary
[
{key : value}
]
Dictionary1
[
{key : value2}
]
If all you want to do is see if the keys are different but not know what they are, you can use the
SequenceEqualextension method on theKeysproperty of each dictionary:If you want the actual differences, something like this: