2023-08-24 17:03:12 +10:00
|
|
|
|
using PARR.API.Settings;
|
|
|
|
|
|
|
|
|
|
|
|
namespace PARR.API.Installers
|
2023-05-17 16:00:50 +10:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Биндинги из конфига appsettings
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static class SettingsInstaller
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void InstallSettings(this IServiceCollection services, IConfiguration configuration)
|
|
|
|
|
|
{
|
2023-09-20 15:27:13 +10:00
|
|
|
|
var mqSettings = new MqSettings();
|
|
|
|
|
|
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
|
|
|
|
|
|
services.AddSingleton(mqSettings);
|
|
|
|
|
|
|
2023-12-01 16:41:37 +10:00
|
|
|
|
var userCacheSettings = new UserCacheSettings();
|
|
|
|
|
|
configuration.GetSection(nameof(UserCacheSettings)).Bind(userCacheSettings);
|
|
|
|
|
|
services.AddSingleton(userCacheSettings);
|
2023-05-17 16:00:50 +10:00
|
|
|
|
|
|
|
|
|
|
//TODO: add other
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|