Checking all entries from one Dictionary are in another Dictionary
<p>i have two Dictionarys A &amp; B, i want to see if all entries in A exist in B. In the past i've compared Lists using the following:</p>

<pre><code>var set1 = new HashSet&lt;String&gt;(list1);
var set2 = new HashSet&lt;String&gt;(list2);

return set1.SetEquals(set2);
</code></pre>

<p>What i have thought to do is simply loop over each value in Dictionary A using:</p>

<pre><code>dictA.TryGetValue(dictBvalue, out item)
</code></pre>

<p>this will return null on the item var if the value isn't there, but this seems a little long winded.</p>

<p>Is there a quick and effcient way of comparing dictionaries?</p>

<p>Thanks.</p>