Esempio n. 1
0
    static Task <int> Main(string[] args)
    {
        var wrapper = new CommandLineApplicationWrapper <Program>(args);

        wrapper.HostBuilder
        .ConfigureServices(services => services.AddSingleton <IQuaxService, QuaxService>())
        .AddConfig <QuaxServiceConfig>(nameof(QuaxService));

        return(wrapper.ExecuteAsync());
    }
Esempio n. 2
0
        static Task <int> Main(string[] args)
        {
            var wrapper = new CommandLineApplicationWrapper <Program>(args);

            wrapper.HostBuilder.ConfigureServices((_, services) => services
                                                  .AddSingleton <KafkaService>()
                                                  .AddSingleton <IReporter, ConsoleReporter>())
            .AddConfig <KafkaServiceConfig>(nameof(KafkaService));

            return(wrapper.ExecuteAsync());
        }
Esempio n. 3
0
        static Task <int> Main(string[] args)
        {
            var wrapper = new CommandLineApplicationWrapper <Program>(args);

            wrapper.HostBuilder.ConfigureServices((hostBuilderContext, services) => services
                                                  .AddSingleton <IReporter, ConsoleReporter>()
                                                  .AddRabbitMqMessageProducer(hostBuilderContext.Configuration)
                                                  );

            return(wrapper.ExecuteAsync());
        }