Startup.Configure builds the ASP.NET Core middleware pipeline and registers endpoint mappings. The host calls ConfigureServices first, then Configure, making registered services available for dependency injection in Configure. Middleware runs in the order it is added. section 30.3 section 30.7
Listing 30.2 An outline of Startup.cs showing how each aspect is configured
public class Startup
{
public void ConfigureServices(IServiceCollection services) #1
{
// method details
}
public void Configure(IApplicationBuilder app) #2
{
// method details
}
}
Use the Startup outline to distinguish Configure from ConfigureServices and see the conventional method shape. section 30.3
A Razor Pages pipeline
A practical Configure method can inject IApplicationBuilder and IWebHostEnvironment, select development or production error handling, then add HTTPS redirection, static files, routing, authentication, authorization, and endpoint mappings. The endpoint stage calls endpoints.MapRazorPages(). section 30.3 section 30.7
