Some containers allow for registration by name. Ninject is one as an example.
Does the .NET Core DI container support this? And if not, are there plans or third party libraries to support this?
Does the .NET Core DI container support this? And if not, are there plans or third party libraries to support this?
Short Answer: NO and NO
Source: Introduction to Dependency Injection in ASP.NET Core
Replacing the default services container
The built-in services container is meant to serve the basic needs of the framework and most consumer applications built on it. However, developers can replace the built-in container with their preferred container. The
ConfigureServices
method typically returns void, but if its signature is changed to returnIServiceProvider
, a different container can be configured and returned. There are many IOC containers available for .NET.
(Emphasis mine)
With that you can check if Ninject has an extension for .net core and see if you can integrate it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With