Solved

c# Compare two dictionaries

Posted on 2010-09-02
1
2,199 Views
Last Modified: 2012-08-13
Hi

I have two dictionary object variables
I want to know if they are different or not. I expect them to be totally alike but I want to have a fast check.
What is the fastest way to compare these two dictionaries. I would prefer not having to loop through them

any ideas?
0
Comment
Question by:liversen
1 Comment
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
Comment Utility
You can't directly compare the list & the dictionary, but you could compare the list of values from the Dictionary with the list

http://msdn.microsoft.com/en-us/library/bb342073.aspx

Enumerable.SequenceEqual

Determines whether two sequences are equal by comparing their elements by using a specified IEqualityComparer(T).

found at: http://stackoverflow.com/questions/43500/is-there-a-built-in-method-to-compare-collections-in-c
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now