ASP.NET Analysis of Core Operating Principles: Startup Startup Class 1. Startup Constructor 2、ConfigureServices 3. Configure method
Startup ClassThe Startup Class contains two important methods: the Configure method is used to handle each HTTP request, such as the Middleware mentioned later, which is configured in the configure method. The ConfigureServices method is called before the Configure method, which is an optional method that can be used in the configureServices dependency injection interface or some global framework, such as EntityFramework, MVC, etc.Startup class's execution order: construct -> configureServices->configure。 1. Startup ConstructorThe main implementation of some configurations is as follows:
|