How does ASP.NET 5 incorporate startup dependencies?

I am studying ASP.NET 5 documentation (this is great and better than the old). I understand that ASP.NET 5 includes a simple built-in inverse of the management container (IoC), which by default supports constructor injection. As far as I know, services and dependencies are configured inside the ConfigureServices() method.

The ConfigureServices() method is called after the StartUp method.

So my question is : how does ASP.NET 5 internally implement Startup Delays?

I would like to know, because if I want to add another dependency like IFooEnviroment , how can I do this?

+7
dependency-injection asp.net-core
source share
1 answer

The logic for this lives in the Hosting level of ASP.NET 5:

You can, of course, register your own services with ConfigureServices . But they will not be available in the constructor, as you have already defined. Unable to add your own services to runtime services. This makes sense because there should be a difference between the runtime services and the applications.

However, you can enter services registered in the ConfigureServices() method in the Configure() method.

+3
source share

All Articles