The implementation is trivial, just inject the IEnumerable<KeyValuePair<TServiceKey, Value>> and call ToDictionary.
Previously there was a doubt to add the wrapper because it may be not obvious if dictionary is referring to service keys or to the metadata.
Now I am more sure of that because the service keys are unique keys but the metadata may be not.
Side fact, in some programming languages e.g. Scala the standard Map data structure implements the Func<Key, Value> interface,
so adding the Dictionary from key to service will provide the shortest migration path from IoC libs which have a specific treatment of Func as Func<Key, Service>.
The implementation is trivial, just inject the
IEnumerable<KeyValuePair<TServiceKey, Value>>
and callToDictionary
. Previously there was a doubt to add the wrapper because it may be not obvious if dictionary is referring to service keys or to the metadata. Now I am more sure of that because the service keys are unique keys but the metadata may be not.Side fact, in some programming languages e.g. Scala the standard Map data structure implements the
Func<Key, Value>
interface, so adding the Dictionary from key to service will provide the shortest migration path from IoC libs which have a specific treatment of Func asFunc<Key, Service>
.