I would like to know how can I declare / initialize a dictionary? Below is the error.
Dictionary<string, List<string>> myD = new Dictionary<string, List<string>>()
{
{"tab1", MyList }
};
List <string> MyList = new List<string>() { "1" };
Error: Field initializer cannot refer to non-static field, method, or property MyList. This is not a List declaration starting at or later after the dictionary.
source
to share