private static void RegisterIntegrations(IServiceCollection services, IConfiguration configuration, NetCorePluginDISettings settings) { foreach (var integrationPath in settings.IntegrationPaths) { var assembly = LoadIntegrationAssembly(integrationPath); RegisterIntegrationsFromAssembly(services, configuration, assembly); } }
public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureServices((hostContext, services) => { var configuration = services.BuildServiceProvider().GetService <IConfiguration>(); var settings = new NetCorePluginDISettings(); configuration.Bind(settings); services.AddSingleton(settings); services.AddHostedService <Worker>(); RegisterIntegrations(services, configuration, settings); });