public void ConfigureServices(IServiceCollection services)
 {
     services.AddHttpContextAccessor();
     services.ConfigureAuthenticationServices(Configuration);
     services.ConfigureApplicationServices(Configuration, WebHostEnvironment);
     services.ConfigureLoggingServices(Configuration);
     MappingExtensions.ConfigureMappingServices();
 }
Example #2
0
        public override void Load()
        {
            MappingExtensions.ConfigureMappingServices();

            LoadConfiguration <Spine>("SELECT * FROM configuration.get_spine_configuration()", "Spine");
            LoadConfiguration <General>("SELECT * FROM configuration.get_general_configuration()", "General");
            LoadConfiguration <Sso>("SELECT * FROM configuration.get_sso_configuration()", "SingleSignOn");
            LoadConfiguration <Email>("SELECT * FROM configuration.get_email_configuration()", "Email");
        }
        public override void Configure(IFunctionsHostBuilder builder)
        {
            MappingExtensions.ConfigureMappingServices();
            builder.Services.AddScoped <IDataService, DataService>();
            builder.Services.AddScoped <IConfigurationService, ConfigurationService>();
            builder.Services.AddScoped <IBlobService, BlobService>();
            builder.Services.AddScoped <IImportService, ImportService>();
            builder.Services.AddScoped <ISplunkService, SplunkService>();

            var configuration = builder.GetContext().Configuration;

            builder.Services.AddLogging(loggingBuilder => LoggingExtensions.ConfigureLoggingServices(loggingBuilder, configuration));
            builder.Services.AddHttpClient("SplunkApiClient", options => Configuration.Infrastructure.HttpClient.HttpClientExtensions.ConfigureHttpClient(options))
            .ConfigurePrimaryHttpMessageHandler(() => Configuration.Infrastructure.HttpClient.HttpClientExtensions.CreateHttpMessageHandler());
            builder.Services.AddSmtpClientServices(configuration);
        }