14 lines
466 B
C#
14 lines
466 B
C#
using SquirrelContract.Infastructure;
|
|
|
|
namespace SquirrelWebApi.Infrastructure;
|
|
|
|
public class ConfigurationDatabase(IConfiguration configuration) : IConfigurationDatabase
|
|
{
|
|
private readonly Lazy<DataBaseSettings> _dataBaseSettings = new(() =>
|
|
{
|
|
return configuration.GetValue<DataBaseSettings>("DataBaseSettings") ?? throw new InvalidDataException(nameof(DataBaseSettings));
|
|
});
|
|
|
|
public string ConnectionString => _dataBaseSettings.Value.ConnectionString;
|
|
}
|