Reputation: 2871
What would be the best data type for storing non-unique pairs of objects? I cannot use Dictionary because the key has to be unique. I could create an object with the two data types as properties and store them in a list, but that wouldn't be flexible enough to accommodate the different data type pairs. Something almost like Dictionary but non-unique. A build-in solution from .NET would be even better.
Upvotes: 3
Views: 2264
Reputation: 4264
You could use List<KeyValuePair<T1,T2>>
. Dictionary
class uses KeyValuePair
too.
Upvotes: 2