Is there an alternative to Dictionary/SortedList that allows duplicates?

Sedat Kapanoglu picture Sedat Kapanoglu · Feb 16, 2009 · Viewed 25.7k times · Source

Possible Duplicate:
C# Sortable collection which allows duplicate keys

Basically I'd like to make a Dictionary work with duplicate keys without going into custom comparer implementations. There is an idea of:

  Dictionary<key, List<value>>

but it still has some overhead. I wish Dictionary had "AllowDuplicates".

Answer

LukeH picture LukeH · Feb 16, 2009

If you're using .NET 3.5 then Lookup is probably what you're after.