Third party DI containers
Last updated
Last updated
To enable third party containers support it is necessary to bootstrap the Radical application using the generic host support. To enable generic host support:
Add a reference to the Microsoft.Extensions.Hosting
nuget package
Change the app boostrapping code as follows:
Using the above code sample the application boostrapping process is now delegated to the generic host. To add support for a different IoC container, for example Autofac, do the following:
Add a reference to the Autofac.Extensions.DependencyInjection
nuget package
Change the HostBuilder
creation section to add Autofac support as follows:
Refer to the documentation of you container of choice to get an overview of the steps required to integrate with the generic host. A full sample is available in the documentation repository at https://github.com/RadicalFx/documentation/tree/master/samples/ThirdPartyContainer