Adds option pattern for smart config
This commit is contained in:
parent
6839cd82e2
commit
f4f2fc47b1
6 changed files with 130 additions and 87 deletions
|
|
@ -0,0 +1,28 @@
|
|||
namespace Core.Configurations.SmartConfig
|
||||
{
|
||||
public class SmartConfigOptions
|
||||
{
|
||||
private SmartConfiguration.IConfigurationRepository _repository;
|
||||
internal string _configKey;
|
||||
|
||||
public SmartConfigOptions UsePostgres(string configKey)
|
||||
{
|
||||
_configKey = configKey;
|
||||
_repository = new Configurations.SmartConfigProvider.Repositories.PostgresConfigurationRepository();
|
||||
return this;
|
||||
}
|
||||
|
||||
public SmartConfigOptions UseSqlServer()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public SmartConfigOptions UseRepository(SmartConfiguration.IConfigurationRepository repository)
|
||||
{
|
||||
_repository = repository;
|
||||
return this;
|
||||
}
|
||||
|
||||
internal SmartConfiguration.IConfigurationRepository GetRepository() => _repository;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue