KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'd like to create a Dictionary object, with string Keys, holding values which are of a generic type. I imagine that it would look something like this: Dictionary<string, List<T>> d = new Dictionary<string, List<T>>(); And enable me to add the following: d.Add("Numbers", new List<int>()); d.Add("Letters", new List<string>()); I know that I can do it for a list of strings, for example, using this syntax: Dictionary<string, List<string>> d = new Dictionary<string, List<string>>(); d.Add("Key", new List<string>()); but I'd like to do it for a generic list if possible... 2 questions then: Is it possible? What's the syntax?
Tags (comma-separated)
Save Edits
Cancel