24 lines
743 B
C#
24 lines
743 B
C#
using PARR.API.Settings;
|
|
|
|
namespace PARR.API.Installers
|
|
{
|
|
/// <summary>
|
|
/// Биндинги из конфига appsettings
|
|
/// </summary>
|
|
public static class SettingsInstaller
|
|
{
|
|
public static void InstallSettings(this IServiceCollection services, IConfiguration configuration)
|
|
{
|
|
var mqSettings = new MqSettings();
|
|
configuration.GetSection(nameof(MqSettings)).Bind(mqSettings);
|
|
services.AddSingleton(mqSettings);
|
|
|
|
var userCacheSettings = new UserCacheSettings();
|
|
configuration.GetSection(nameof(UserCacheSettings)).Bind(userCacheSettings);
|
|
services.AddSingleton(userCacheSettings);
|
|
|
|
//TODO: add other
|
|
}
|
|
}
|
|
}
|