Пример #1
0
        private static IServiceCollection ConfigureDi(IServiceCollection services, IConfiguration config)
        {
            RabbitMQConfigurations.ConfigureServices(services, config);
            StorageConfigurations.ConfigureServices(services, config);

            return(services
                   .AddSingleton(config)

                   .AddTransient <IFileArchiver, FileArchiver>()
                   .Configure <FileArchiver>(config)
                   .AddTransient <IAzureService, AzureService>()
                   .Configure <AzureService>(config)
                   .AddTransient(x => new ProcessKiller(config))
                   .AddScoped <IQueueService, QueueService>()
                   .AddLogging(loggingBuilder =>
            {
                // configure Logging with NLog
                loggingBuilder.ClearProviders();
                loggingBuilder.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
                loggingBuilder.AddNLog();
            })
                   .AddTransient <IAzureService, AzureService>()
                   .Configure <AzureService>(config)
                   .AddTransient <IProjectBuilder, ProjectBuilder>()

                   .AddTransient <GoConsoleBuilder>()
                   .AddTransient <TSConsoleBuilder>()
                   .AddTransient <CSharpConsoleBuilder>()
                   .Configure <CSharpConsoleBuilder>(config)
                   .Configure <TSConsoleBuilder>(config)
                   .Configure <GoConsoleBuilder>(config));
        }
Пример #2
0
        public static void RegisterCustomServices(this IServiceCollection services, IConfiguration configuration)
        {
            services.AddScoped <JwtIssuerOptions>();

            BLLConfigurations.ConfigureServices(services, configuration);

            DALConfigurations.ConfigureServices(services, configuration);

            RabbitMQConfigurations.ConfigureServices(services, configuration);
        }