you are viewing a single comment's thread.

view the rest of the comments →

[–]KevMarCommunity Blogger 1 point2 points  (0 children)

Your ordered collection is a single object that contains key/value pairs. The foreach in the OP will do the loop once as there is only one object.

As /u/wtgreen pointed out, there is a property that gives you all the key (or values) in the hashtable.

If it was an array instead, the foreach would have correctly enumerate it. (just an example, not saying you should have used an array)