In .NET 2.0, HashSet<T>you can use instead Dictionary<K, V>.
Dictionaryuses a hash code to perform key searches, so it has a similar action with HashSet. There are at least two approaches:
- Create your own class or structure containing the name and reference, and use this as a key in the dictionary and put the object as a value.
- Store the entire object as a key and provide your own comparison mapper, which looks only at the Name and Link element and sets to null.
The second method is very similar to how you would use a HashSet if it was available.
source
share