You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 2, 2023. It is now read-only.
Last summer I looked into new collections to consider adding to .NET. I ultimately decided on adding the MultiValueDictionary, but a close contender was the bi-directional dictionary. Now that we have corefxlab and we're working in the open, I'd like to revisit the BiDictionary as a possible addition.
If I remember correctly, my basic implementation for a BiMap that I took to API review a year ago had two Dictionaries – one that maps from Key->Value and the other that maps Value->Key. Any time the BiMap is mutated, both internal dictionaries have to be updated. There was also a Property “Reverse” to get the Value->Key mapping such that you could do:
Both “map” and “reverse” used the same internal store.
So moving forward we should look at the above as our “worst case” scenario. I think we can do something more clever.
The biggest design issue I'd like to get resolved is whether we should Implement IDictionary<TKey, Value> and IDictionary<TValue, TKey> or just the former.