Building a sorted dictionary using ToDictionary
I'm not an expert in C# and LINQ. I have a Dictionary , which I understand a hash table, that is, keys are not sorted. dataBase = new Dictionary<string, Record>() Record is a user-defined class that holds a number of data for a given key string. I found an interesting example that converts this Dictionary into a sorted dictionary by LINQ: var sortedDict = (from entry in dataBase orderby entry.Key ascending select entry) .ToDictionary(pair => pair.Key, pair => pair.Value); This code works correctly. The resulting sortedDict is sorted by keys. Question : I found that sortedDict is still a hash