how to add duplicate keys to dictionary
i.e i have already added the key,value pair as rollno,1 but i need to add the same parameter to the dictionary,but it is not allowing to add. how to add duplicated keys/repeated key in dictionary .
or any other choice.. any idea???
That doesn't make sense, if you added duplicate keys to the dictionary, how would it be able to find which one you want when you look them up?
Possibly you're looking for something like a List< KeyValuePair < T, T > >? Where you could store a list of pairs rather than an actual dictionary.
Check out this:
What is the point of Lookup<TKey, TElement>?
You can use the Lookup class to help you create collections with duplicates keys.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With