Files

43 lines
1.1 KiB
C#

namespace EgwCoreLib.Lux.Data.Services.Production
{
public class ProductionPlantService : BaseServ, IProductionPlantService
{
#region Public Constructors
public ProductionPlantService(
IConfiguration config,
IConnectionMultiplexer redis,
IProductionPlantRepository repo) : base(config, redis)
{
_className = "ProdPlant";
_repo = repo;
}
#endregion Public Constructors
#region Public Methods
/// <inheritdoc />
public async Task<List<ProductionPlantModel>> GetAllAsync()
{
return await TraceAsync($"{_className}.GetAllAsync", 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 IProductionPlantRepository _repo;
#endregion Private Fields
}
}