I don't understand why this happens:
var demoDict = new Dictionary<string, string>()
{
{"key", "value" }
};
for (int i = 0; i < 2; i++)
{
var tempDict = demoDict;
tempDict.TryAdd("keyAdded", "valueAdded");
}
Imagine i have a code like this, why does the TryAdd to the tempDict add the Key into the demoDict too?
When you do the same thing with Classes or Integers for example, this behavior does not happen.