2020-08-08 08:53:35 +02:00
|
|
|
|
namespace Giants.Services
|
|
|
|
|
{
|
2020-08-09 01:31:16 +02:00
|
|
|
|
using Giants.Services.Core;
|
2020-08-09 11:10:33 +02:00
|
|
|
|
using Microsoft.Extensions.Caching.Memory;
|
2020-08-09 01:31:16 +02:00
|
|
|
|
using Microsoft.Extensions.Configuration;
|
2020-08-08 08:53:35 +02:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
public static class ServicesModule
|
|
|
|
|
{
|
2020-08-09 01:31:16 +02:00
|
|
|
|
public static void RegisterServices(IServiceCollection services, IConfiguration configuration)
|
2020-08-08 08:53:35 +02:00
|
|
|
|
{
|
|
|
|
|
services.AddSingleton<IServerRegistryService, ServerRegistryService>();
|
2020-08-09 01:31:16 +02:00
|
|
|
|
services.AddSingleton<IServerRegistryStore, CosmosDbServerRegistryStore>();
|
|
|
|
|
services.AddSingleton<IDateTimeProvider, DefaultDateTimeProvider>();
|
2020-08-09 11:10:33 +02:00
|
|
|
|
services.AddSingleton<IMemoryCache, MemoryCache>();
|
2020-08-09 02:26:41 +02:00
|
|
|
|
|
2020-08-09 02:52:26 +02:00
|
|
|
|
services.AddHostedService<InitializerService>();
|
2020-08-09 02:26:41 +02:00
|
|
|
|
services.AddHostedService<ServerRegistryCleanupService>();
|
2020-08-08 08:53:35 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|