A dictionary with multiple entries with the same key

Viewed 72339

I need a Dictionary like object that can store multiple entries with the same key. Is this avaliable as a standard collection, or do I need to roll my own?

To clarify, I want to be able to do something like this:

var dict = new Dictionary<int, String>();
dict.Add(1, "first");
dict.Add(1, "second");

foreach(string x in dict[1])
{
    Console.WriteLine(x);
}

Output:

first
second
6 Answers
Related