"Return order of elements undefined". I know there is SortedDictionary, but if I jus...">

Solutions for the word "keeping order"

For Dictionary<,>"Return order of elements undefined".

I know there is SortedDictionary, but if I just want a dictionary that returns the elements to me in the order in which I insert them, what is the best thing to do?

I think I should use List<KeyValuePair<,>>and convert it to a dictionary when I need to do a search (as opposed to a profile in a dictionary).

Or did I miss something smarter?

+3
source share
2 answers

There is no generic class that does this: OrderedDictionary , but there is currently no generic version.

+4
source

, . , /, / ( Clear()). .

, ​​ , ..

+2

Source: https://habr.com/ru/post/1760481/


All Articles