views:

193

answers:

1

I have a type of object called Bin, which has a hashtable field called Attributes. Like so:

Public Class Bin

    Private _attributes As Hashtable

    Public Readonly Property Attributes() As Hashtable
        Get
            Return _attributes
        End Get
    End Property

End Class

If I have two bins, I'd like to compare if they have the same attributes (if they have the exact same keys, as well as the right values for those keys) in the Hashtable. I have a set of constants (String) for the key, but the value will be a Boolean.

If there's an easy way to do it with Dictionaries, I'd be open to that too. I haven't used this aspect of vb.net so I'm not really sure what's possible, or if I'll have to hand-code the comparison.

+1  A: 

Here is a small discussion

How to compare 2 HashTables?

It seems that you would have to code your own comparison method to implement what you are looking for.

Also maybe have a look at

Why Dictionary is preferred over hashtable

astander