public static IServiceCollection ConfigureDI(this IServiceCollection services, IConfiguration configuration)
        {
            services.AddEventHub(configuration);

            DIFactory.ConfigureDI(services);

            return(services);
        }
示例#2
0
        static void Main(string[] args)
        {
            // create a command line runner class with a logger and configuration injected
            var CLIServiceProvider = new DIFactory <CommandLineRunner>();
            var servicesProvider   = CLIServiceProvider.ConfigureDI();

            // get the command line runner
            var runner = servicesProvider.GetRequiredService <CommandLineRunner>();

            // do the command line action
            runner.CommandLineAction(args);

            // make sure nlog ends well ;-)
            NLog.LogManager.Shutdown();

            Console.WriteLine("Press any key");
            Console.ReadLine();
        }
        public static IServiceCollection ConfigureDI(this IServiceCollection services, IConfiguration configuration)
        {
            DIFactory.ConfigureDI(services);

            return(services);
        }
示例#4
0
 public static IServiceCollection ConfigureDI(this IServiceCollection services, IConfiguration configuration) => DIFactory.ConfigureDI(services, configuration);