Hello,
I am stumped as to why I can’t get KeyValuePair<> use to compile
KeyValuePair<int, int> fuuuuu = new KeyValuePair<int, int>(1, 1);
fuuuuu.Value = 5;
Error: System.Collections.Generic.KeyValuePair<int,int>.Value’ is inaccessible due to its protection level
Please help! /-_-\
The “Value” property is read-only, which is why the second line in your example is not allowed.
I could have sworn I have used it otherwise…but you’re right KeyValuePair<TKey,TValue>.Value Property (System.Collections.Generic) | Microsoft Learn
Damn my C# skills are in the toilet.
Thanks for your help