Ninject.Web.AspNetCore icon indicating copy to clipboard operation
Ninject.Web.AspNetCore copied to clipboard

Implement new .NET 8 IKeyedServiceProvider interface

Open elca-lan opened this issue 2 years ago • 0 comments

With .NET 8 a new interface was added that should(?) be implemented by service providers, the IKeyedServiceProvider

Explanations and documentation:

  • https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-8.0#keyed-services
  • https://andrewlock.net/exploring-the-dotnet-8-preview-keyed-services-dependency-injection-support/
  • https://weblogs.asp.net/ricardoperes/net-8-dependency-injection-changes-keyed-services

We should implement that interface too. It should be relatively easy to do this with a binding constraint since we already store the entire ServiceDescriptor in the binding metadata. From there we can access the ServiceDescriptor.ServiceKey and find the exact binding.

elca-lan avatar Nov 15 '23 10:11 elca-lan