我需要制作一个Dictionary<string, List<int>>. 我试过:
Dictionary<string, List<int>> tmpStudents =
new Dictionary<string, List<int>>(students);
Run Code Online (Sandbox Code Playgroud)
但操纵 中的值tmpStudents仍在改变 中的值students。中的列表似乎tmpStudents仍在引用中的列表students,但我不确定如何在不手动深度复制每个列表的情况下解决此问题。
c# ×1