C# dictionary value clearing out when I clear list previously assigned to it….why?

The dictionary contains the same reference to the list, so modifying the list will change both references.

Microsoft documentation about reference types: http://msdn.microsoft.com/en-us/library/490f96s2.aspx

Leave a Comment