-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for keyed services #97
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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