| | 1 | | using Microsoft.Extensions.DependencyInjection; |
| | 2 | | using MRA.Infrastructure.Database.Providers; |
| | 3 | | using MRA.Infrastructure.Storage; |
| | 4 | | using MRA.Infrastructure.Excel; |
| | 5 | | using MRA.Infrastructure.RemoteConfig; |
| | 6 | | using MRA.Infrastructure.Cache; |
| | 7 | | using Microsoft.Extensions.Caching.Memory; |
| | 8 | | using MRA.Infrastructure.Database.Providers.Interfaces; |
| | 9 | | using MRA.Infrastructure.Storage.Connection; |
| | 10 | | using MRA.Infrastructure.UserInput; |
| | 11 | |
|
| | 12 | | namespace MRA.DependencyInjection.Startup; |
| | 13 | |
|
| | 14 | | public static class InfrastructureStartup |
| | 15 | | { |
| | 16 | | public static void AddCustomInfrastructure(this IServiceCollection services) |
| | 17 | | { |
| 1 | 18 | | services.AddSingleton<IDocumentsDatabase, MongoDbDatabase>(); |
| | 19 | |
|
| 1 | 20 | | services.AddSingleton<IAzureStorageConnection, AzureStorageConnection>(); |
| 1 | 21 | | services.AddSingleton<IStorageProvider, AzureStorageProvider>(); |
| | 22 | |
|
| 1 | 23 | | services.AddSingleton<IUserInputProvider, ConsoleProvider>(); |
| 1 | 24 | | services.AddSingleton<IExcelProvider, EPPlusExcelProvider>(); |
| 1 | 25 | | services.AddSingleton<IRemoteConfigDatabase, AzureAppConfigurationDatabase>(); |
| | 26 | |
|
| 1 | 27 | | services.AddSingleton<IMemoryCache>(new MemoryCache(new MemoryCacheOptions())); |
| 1 | 28 | | services.AddSingleton<ICacheProvider, MicrosoftCacheProvider>(); |
| 1 | 29 | | } |
| | 30 | | } |