Startup class is responsible for managing/registering of two essential components of your application, namely
- the middleware pipeline
- the implementation of service registration.
Services
Your application is dependent on services, which are classes written in C#, in order to provide additional functionality. These services are utilized by both the framework and your application.
- In order for these services to be instantiated when your application is running and when it requires them, they must first be registered.
- There are several examples, such as logging and get data from database
Middlewre Pipeline
- It is the sequence in which application handles an HTTP request
Methods in Startup Class
ConfigureServices() and Configure() are the two methods that are contained within the Startup class.
- ConfigureServices method, is responsible for registering all of the services that the application requires.
- Configure method, Handle Middleware pipeline configuration