Files
lux/EgwCoreLib.Lux.Data/Services/Production/ProductionBatchService.cs
T
Samuele E. Locatelli (W11-AI) a17a586ddb COmpleto review doc interfacce
2026-03-25 14:02:28 +01:00

42 lines
1.2 KiB
C#

namespace EgwCoreLib.Lux.Data.Services.Production
{
public class ProductionBatchService : BaseServ, IProductionBatchService
{
#region Public Constructors
public ProductionBatchService(
IConfiguration config,
IConnectionMultiplexer redis,
IProductionBatchRepository repo) : base(config, redis)
{
_className = "ProdBatch";
_repo = repo;
}
#endregion Public Constructors
#region Public Methods
/// <inheritdoc />
public async Task<ProductionBatchModel?> CreateAsync(ProductionBatchModel entity)
{
return await TraceAsync($"{_className}.Create", async (activity) =>
{
return await GetOrSetCacheAsync(
$"{_redisBaseKey}:{_className}:{entity.ProdBatchID}",
async () => await _repo.CreateAsync(entity),
FastCache
);
});
}
#endregion Public Methods
#region Private Fields
private readonly string _className;
private readonly IProductionBatchRepository _repo;
#endregion Private Fields
}
}