Generic Dictionary Linking?

I need a generic Dictionary like this: Dictionary<int, string, string, string>.

Q. Is there a way to link/gang Dictionary's together to build larger ones?

Note: I've already discovered this one, but I'm looking for another alternative.
Who is Participating?
ViceroyFizzlebottomConnect With a Mentor Commented:
I don't know what you're trying to store in the Dictionary, but here is kindof an example:

string custName = "Fred";
            string custAddress = "12345 Street 1";
            string custZip = "90210";
            int custId = 1;
            IList<string> custData = new List<string>();
            //Now we want to store all this information for easy retrieval later
            Dictionary<int, IList<string>> dictionary = new Dictionary<int, IList<string>>();
            dictionary.Add(custId, custData);
            // Now to access data for a customer
            if (dictionary.ContainsKey(1))
                IList<string> newCustData = dictionary[1];
                foreach (string item in newCustData)

Open in new window

I don't know if I'm interpreting your question correctly, but could you simply use a IList<string> lookup? Using the int as a key, you could then have access to the three strings, but you wouldn't be constrained by the content going into the IList.

Dictionary<int, IList<string>>
pointemanAuthor Commented:
Over my head on that one. Do you have a code example?
pointemanAuthor Commented:
Great example. I'm working with it as we speak...
pointemanAuthor Commented:
Excellent... Thank You
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.