Key-Value pair list - not sorted

  • Thread starter Thread starter Sehboo
  • Start date Start date
S

Sehboo

I am trying to use key value pair list, but I don't want to use sorted
list because it messes up my order. I am not sure what other options
I have. Can anybody point?

Thanks
 
I am trying to use key value pair list, but I don't want to use sorted
list because it messes up my order. I am not sure what other options
I have. Can anybody point?

Thanks

If you have a specific order of key value pairs you want to store, you
could use the generic list structure with key value pairs in it:

System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<TKey,
TValue>>

But if you are trying to store them in a certain order, then it sounds
like you probably shouldn't be using key value pairs, but instead use
a struct that unites the two. The point of key value pairs is to look
them up by their key.
 
Back
Top