Exemple #1
0
 private static void RegisterIntegrations(IServiceCollection services, IConfiguration configuration,
                                          NetCorePluginDISettings settings)
 {
     foreach (var integrationPath in settings.IntegrationPaths)
     {
         var assembly = LoadIntegrationAssembly(integrationPath);
         RegisterIntegrationsFromAssembly(services, configuration, assembly);
     }
 }
Exemple #2
0
        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);
        });