Add support for keyed services#97
Conversation
|
(I'm not contributor). +1 for this PR but seems it doesn't compile https://ci.appveyor.com/project/unitycontainer/microsoft-dependency-injection-02uof/builds/49796976 |
|
@microsoft-github-policy-service agree |
|
@veselfil Does this PR going to complete? Hit similar issues and trying to seek support for keyed services in the package as well. |
| else if (serviceDescriptor.KeyedImplementationFactory != null) | ||
| { | ||
| container.RegisterFactory(serviceDescriptor.ServiceType, | ||
| (string)serviceDescriptor.ServiceKey, |
There was a problem hiding this comment.
@veselfil this need to change as serviceDescriptor.ServiceKey.ToString() instead of casting directly, otherwise it may throw exceptions in some scenario.
There was a problem hiding this comment.
Same for other places about casting as string
|
@ENikS Would you please check this proposal? This is related to this discussion: dotnet/runtime#95789 Thanks |
|
Just noticed this, I'm sorry... https://www.gofundme.com/f/eugene-sadovoi |
A quick fix to add support for Keyed services introduced in .NET 8