At first my thought was like "this is an hash-based data type, then it is unsorted".
Then since I was about to use it I examined the matter in depth and found out that this class implements IEnumerable
and also this post confirmed that it is possible to iterate over this kind of data.
So, my question is: if I use foreach
over a ConcurrentDictionary
which is the order I read the elements in?
Then, as a second question, I'd like to know if the sorting methods inherited by its interfaces are of any kind of use. If I call a sorting method over a ConcurrentDictionary
the new order will persist (for example for an incoming foreach
)?.
Hope I've made myself clear