Closed
Description
We should introduce a new set of interfaces: IAsyncStartup
and IAsyncStartupFilter
with the following API surface:
public interface IAsyncStartup
{
IServiceProvider ConfigureServices(IServiceCollection services);
Task ConfigureAsync(IApplicationBuilder app);
}
public interface IAsyncStartupFilter
{
Func<IApplicationBuilder, Task> Configure(Func<IApplicationBuilder, Task> next);
}
Startup classes will now support a Task ConfigureAsync(IApplicationBuilder app)
method, which is mutually exclusive with void Configure(IApplicationBuilder app)
. It shall be an error to have both methods on a startup class.
IAsyncStartup
and IAsyncStartupFilter
will be the primitives used by the entire Hosting pipeline. Adapters will exist in Hosting to allow the continued use of IStartup
and IStartupFilter
in the public API surface (to reduce breaking changes).