Member-only story
In the last article I explained the architecture of how .NET functions. In this article I will explain ASP.NET, object lifecycle, and how web APIs work in .net.
How does the application execute?
Before discussing the Startup.cs. file need to understand the application’s order of execution.

From the diagram above the starting point of the application is the Main method located in Program.cs. The Main method calls the CreateHostBuilder method which creates an asp.net core host to host the application and then calls the startup class to configure the application.

Application Startup
Startup class is the entry point to setting up configuration and wiring up services. Developers create a request pipeline in the Startup class that is used to handle all the requests made to the application. The application receives a Configuration file in ConfigureServices method to retrieve api-key’s for each name-type client.