Files
lux/EgwCoreLib.Lux.Data/Services/Config/EnvirParamService.cs
T
2026-03-25 10:03:13 +01:00

42 lines
1.1 KiB
C#

namespace EgwCoreLib.Lux.Data.Services.Config
{
public class EnvirParamService : BaseServ, IEnvirParamService
{
#region Public Constructors
public EnvirParamService(
IConfiguration config,
IConnectionMultiplexer redis,
IEnvirParamRepository repo) : base(config, redis)
{
_className = "EnvirParam";
_repo = repo;
}
#endregion Public Constructors
#region Public Methods
/// <inheritdoc />
public async Task<List<EnvirParamModel>> GetAllAsync()
{
return await TraceAsync($"{_className}.GetAll", async (activity) =>
{
return await GetOrSetCacheAsync(
$"{_redisBaseKey}:{_className}:ALL",
async () => await _repo.GetAllAsync(),
UltraLongCache
);
});
}
#endregion Public Methods
#region Private Fields
private readonly string _className;
private readonly IEnvirParamRepository _repo;
#endregion Private Fields
}
}