WIP on Config Handling
This commit is contained in:
parent
4dc03f2cbf
commit
8e6492e979
17 changed files with 314 additions and 288 deletions
|
|
@ -0,0 +1,24 @@
|
|||
using System.Data;
|
||||
using Insight.Database;
|
||||
|
||||
namespace Core.Configurations.SmartConfiguration;
|
||||
public class ConfigurationRepository : IConfigurationRepository
|
||||
{
|
||||
private readonly IDbConnection _connection;
|
||||
|
||||
public ConfigurationRepository(IDbConnection connection)
|
||||
{
|
||||
_connection = connection;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<AppConfiguration>> GetActiveConfigurations()
|
||||
{
|
||||
const string sql = @"
|
||||
SELECT id, key, value, label, content_type, valid_from, expires_at, created_at, modified_at, etag
|
||||
FROM prod.app_configuration
|
||||
WHERE (expires_at IS NULL OR expires_at > CURRENT_TIMESTAMP)
|
||||
AND (valid_from IS NULL OR valid_from < CURRENT_TIMESTAMP)";
|
||||
|
||||
return await _connection.QueryAsync<AppConfiguration>(sql);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue