using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; using PERMDAL.DTOs; using PERMDAL.Interfaces; using PERMDAL.QueryBuilders; namespace PERMDAL.Implementations; public class PermConfigDAL : IPermConfigDAL { private readonly IQueryExecutor _qe; public PermConfigDAL(IQueryExecutor queryExecutor) => _qe = queryExecutor; public async Task GetConfigValueAsync(string key, LoginDTO login, CancellationToken ct) { var dto = await _qe.QuerySingleAsync(login, PermConfigQB.GET_BY_KEY, new { ConfigKey = key, TenantId = login.ClientId }) .ConfigureAwait(false); return dto?.ConfigValue; } public async Task> GetAllConfigAsync(LoginDTO login, CancellationToken ct) => await _qe.QueryAsync(login, PermConfigQB.GET_ALL, new { TenantId = login.ClientId }, cancellationToken: ct) .ConfigureAwait(false) ?? Enumerable.Empty(); }