Why use LINQ? There is a constructor for this:
new SortedDictionary<int, string>(existing);
You could add a ToSortedDictionary
– but I wouldn’t bother…
Note: this is an answer to the title of the question (convert a Dictionary
to a SortedDictionary
for the same types, if you need additional step that OP is looking for – swap key and values in the process – as shown in the updated problem, see this answer.