do defined route added to the the routes table when the app.Run() executed or before?
I previously asked about the roles of UseRouting and UseEndpoints, and the answer was that UseRouting matches incoming requests against predefined routes in the route table. My question now is about the route table itself: Are the routes added to the route table before or after app.Run() is executed? I’m asking this because, during a debugging session, the application seems to go through the middleware pipeline step by step, executing each middleware until app.Run() is reached, after which the program starts.
4 Replies
Do you mean stepping through in the Program.cs?
yes
Thats not the actual Pipeline. Thats just the registering of the pipeline.
The pipeline runs, when a http request comes in. And the program only runs after app.Run is called.
in that regestration dose the routes url got regiesterd in the routes table