Using DryIoc version 6.0.0-preview-7.
This is in an .NET 8 application, that also has DryIoc.Microsoft.DependencyInjection 8.0.0-preview-02, should it matter.
All options are default ones (for MS DI package).
Setup
We register multiple instances of IService with different (string) keys.
container.Register(serviceType, implementationType, reuse, ifAlreadyRegistered, serviceKey /* :string */)
Then we inject IEnumerable<KeyValuePair<object, IService>> into a ctor.
Result
The keys are not strings but DryIoc internal UniqueRegisteredServiceKey, which should have been unwrapped.
Trying to inject IEnumerable<KeyValuePair<string, IService>> fails (no result), which makes sense given the previous result.
Using DryIoc version
6.0.0-preview-7
. This is in an .NET 8 application, that also hasDryIoc.Microsoft.DependencyInjection 8.0.0-preview-02
, should it matter. All options are default ones (for MS DI package).Setup
We register multiple instances of
IService
with different (string) keys.container.Register(serviceType, implementationType, reuse, ifAlreadyRegistered, serviceKey /* :string */)
Then we inject
IEnumerable<KeyValuePair<object, IService>>
into a ctor.Result
The keys are not strings but DryIoc internal
UniqueRegisteredServiceKey
, which should have been unwrapped. Trying to injectIEnumerable<KeyValuePair<string, IService>>
fails (no result), which makes sense given the previous result.