Programmer Question
I'm having trouble with the following collections initalization:
private Dictionary<string, string> mydictionary = new Dictionary<string, string>()
{
{"key", "value"}
, {"key2", "value2"}
, {"key3", "value3"}
};
I keep getting various compiler errors about the syntax. From what I have googled this should be perfectly valid C# 3.0 code.
The first error that pops up is:
Error 102 ; expecte
What am I doing wrong?
Find the answer here
No comments:
Post a Comment