Esempio n. 1
0
 public WebApplicationContext()
 {
     ServiceProviderBuilder
     .ConfigureServices <WebDependencyConfigurator>()
     .ConfigureServices <RabitMqDependencies>()
     .ConfigureServices <JsonDependencyies>();
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // Prepare dependency injection container
            var serviceProvider = ServiceProviderBuilder.ConfigureServices();

            // Get logger
            var logger = serviceProvider.GetService <ILogger <Program> >();

            var demoFactory = serviceProvider.GetService <DemoFactory>();

            var name = args != null && args.Length > 0 ? args[0] : "Invalid";

            logger.LogInformation($"Demo name: {name}");

            using var demo = demoFactory.Create(name);

            demo.RunAsync().Wait();

            Console.ReadLine();
        }
Esempio n. 3
0
 public DefaultClientAppContext()
 {
     ServiceProviderBuilder
     .ConfigureServices <ClientDependencyConfigurator>();
 }