Is there a class like a Dictionary without a Value template? Is HashSet<T> the correct answer?
- by myotherme
I have 3 tables: Foos, Bars and FooBarConfirmations
I want to have a in-memory list of FooBarConfirmations by their hash:
FooID BarID Hash
1 1 1_1
2 1 2_1
1 2 1_2
2 2 2_2
What would be the best Class to use to store this type of structure in-memory, so that I can quickly check to see if a combination exists like so:
list.Contains("1_2");
I can do this with Dictionary<string,anything>, but it "feels" wrong.
HashSet looks like the right tool for the job, but does it use some form of hashing algorithm in the background to do the lookups efficiently?