Working on this data setup logic

This commit is contained in:
Janus C. H. Knudsen 2025-01-28 14:51:09 +01:00
parent 384cc3c6fd
commit 447b27f69b
16 changed files with 409 additions and 211 deletions

View file

@ -2,7 +2,7 @@ using System.Data;
using Insight.Database;
namespace Configuration.Core;
public class ConfigurationRepository : IConfigurationRepository
public class ConfigurationRepository : IConfigurationRepository
{
private readonly IDbConnection _connection;
@ -16,8 +16,8 @@ namespace Configuration.Core;
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)";
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);
}