-
Notifications
You must be signed in to change notification settings - Fork 1
/
Startup.cs
46 lines (39 loc) · 1.75 KB
/
Startup.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using Amazon.S3;
using Gentrack.Tools.DataReplicationLoadTool.Consumers;
using Gentrack.Tools.DataReplicationLoadTool.Producers;
using Gentrack.Tools.DataReplicationLoadTool.Providers;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Gentrack.Tools.DataReplicationLoadTool
{
internal class Startup
{
public IConfigurationRoot Configuration { get; }
public Startup()
{
var builder = new ConfigurationBuilder()
.AddJsonFile("appsettings.json");
Configuration = builder.Build();
}
public void ConfigureServices(IServiceCollection services)
{
services.AddLogging(configure =>
{
configure.AddConfiguration(Configuration.GetSection("Logging"));
configure.AddConsole();
}).Configure<LoggerFilterOptions>(options => options.MinLevel = LogLevel.Information);
services.AddSingleton<IConfigurationRoot>(Configuration);
// Add AWS Services
services.AddDefaultAWSOptions(Configuration.GetAWSOptions());
services.AddAWSService<IAmazonS3>();
// Add Our Own Services
services.AddTransient<IDatabaseService, SqlServerDatabaseService>();
services.AddTransient<IRemoteEndpointService, S3Service>();
services.AddTransient<IFileProducer, S3FileProducer>();
services.AddTransient<IFullLoadFileConsumer, FullLoadFileConsumer>();
services.AddTransient<IDeltaFileConsumer, DeltaFileConsumer>();
services.AddTransient<ILocalCacheService, LocalCacheService>();
}
}
}