- ConfigureServices() and Configure() methods are used to register services and configure components within the request pipeline respectively.
- ConfigureServices() takes a parameter of type IServiceCollection.
- Configure() takes a parameter of type IApplicationBuilder with possible parameters of any Service which is registered in the ConfigureServices() method.
- an application should contain an ConfigureServices() method with an optional Configure() method.
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
}
public void Configure(IApplicationBuilder app)
{
}
}