我有以下代码:
Dictionary<string, string>[] Records = new Dictionary<string, string>[2];
Dictionary<string, string> newFields = new Dictionary<string, string>();
newFields["Item"] = "M1";
newFields["Value"] = "V1";
Records[0] = newFields;
newFields["Item"] = "M2"; // This also changes values in Records[0]
newFields["Value"] = "V2";
Records[1] = newFields;
但是,一旦我再次分配 newFields,它也会更改 Records[0] 中的值??????????????