42 lines
1.2 KiB
C#
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
|
|
}
|
|
} |