Is there a dictionary available in .NET that could hold 2 keys and one value.
Like
Dictionary(Of TKey, Of TKey, TValue)
I have
You can't do it just with a single Dictionary without losing look up speed. The reason is that if you were to create a composite key there is no meaningful value you can return when you override GetHashCode. This means an equality comparison would need to be done against every key until a dictionary entry is found. You would also have a potential problem with a composite key in this case: because your Equals method would check whether one property or the other are equal, the following keys would essentially be duplicate keys { Id=1, Name="Bob" } { Id=1, Name="Anna" }, which doesn't give me a warm fuzzy feeling.
This leaves you with wrapping a dictionary, or pair of dictionaries with your own class.