Closed jakhog closed 4 years ago
@woksin: the AspNetCore Bootstrap needs to be changed so that it doesn't do that anymore. Essentially it should just add AspNetCore specific things - like the ExecutionContext middleware, Command/Query-coordinators etc.
This PR contains a
ServiceProviderFactory
that uses theAutofacServiceProviderFactory
and the Dolittle booting process to set up the container, and to run the boot procedures.In principle - it performs the following steps:
ServiceCollection
. The service collection is typically set up in aStartup
class, and through otherHostBuilder
extension methods.BootProcedures
) to discover bindings and set up the initial system.IContainer
that uses theServiceProvider
to create instances, and notifies Dolittle internals that the container is ready.ILoggerFactory
with some workarounds to help developers) and configures the logging system to use these new logging providers from now on and flushes logs captured during booting.BootProcedures
to finalise the Dolittle booting process.There is also a
IHostBuilder
extension method called.UseDolittle()
that configures the host builder to use theServiceProviderFactory
described above. Typical use of this would be in aProgram
class:┆Issue is synchronized with this Asana task