1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-05 23:05:38 +01:00
GiantsTools/Giants.Services/Core/ServicesModule.cs
2020-08-10 00:29:28 -07:00

25 lines
1012 B
C#

namespace Giants.Services
{
using Giants.Services.Core;
using Giants.Services.Store;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
public static class ServicesModule
{
public static void RegisterServices(IServiceCollection services, IConfiguration configuration)
{
services.AddSingleton<IServerRegistryService, ServerRegistryService>();
services.AddSingleton<IServerRegistryStore, CosmosDbServerRegistryStore>();
services.AddSingleton<IDateTimeProvider, DefaultDateTimeProvider>();
services.AddSingleton<IMemoryCache, MemoryCache>();
services.AddSingleton<IUpdaterStore, CosmosDbUpdaterStore>();
services.AddSingleton<IUpdaterService, UpdaterService>();
services.AddHostedService<InitializerService>();
services.AddHostedService<ServerRegistryCleanupService>();
}
}
}