Add support for BuildHostApplicationBuilder
Support for BuildHost with the HostApplicationBuilder:
public class Startup
{
// with
public void ConfigureHostApplicationBuilder(IHostApplicationBuilder hostApplicationBuilder)
{
// do something here...
}
// will be able to
public IHost BuildHostApplicationBuilder(HostApplicationBuilder hostApplicationBuilder)
{
var hostApplication = hostApplicationBuilder.Build();
// do something here...
return hostApplication;
}
}
Could it be configured in the Configure method? We could inject any service registered in the service collection like IServiceProvider
https://github.com/pengweiqhca/Xunit.DependencyInjection/blob/d55ca649090492565a5f2ec088898370dd030724/test/Xunit.DependencyInjection.Test/HostApplicationBuilderTest.cs#L35
Configure method doesn't allow access to the IHost instance like the BuildHost method for the CreateHostBuilder, this could help if thirdparty libraries uses the IHost instead of the IServiceProvider
what about supporting IHost in the Configure method?
Configure method doesn't allow access to the IHost instance like the BuildHost method for the CreateHostBuilder, this could help if thirdparty libraries uses the IHost instead of the IServiceProvider
That is not work?
public static void Configure(IHost host) => Counter++;