My idea was to copy a dictionary while resetting all the values of the previous one, so i have this instruction:
var dic2 = new Dictionary<string, int>(dic.ToDictionary(kvp => kvp.Key, kvp => 0));
However i had an unexpected problem doing this, since the new copied dictionary doesnt have the same order of keys of the previous one.
Any way to reset the values but to maintain the same order of keys? Witouth resorting to some type of sorting?