[Add] MasterData Services.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using AMREZ.EOP.Abstractions.Applications.UseCases.MasterData.Allergen;
|
||||
using AMREZ.EOP.Abstractions.Infrastructures.Repositories;
|
||||
using AMREZ.EOP.Contracts.DTOs.MasterData.Allergen;
|
||||
|
||||
namespace AMREZ.EOP.Application.UseCases.MasterData.Allergen;
|
||||
|
||||
public class GetAllergenUseCase : IGetAllergenUseCase
|
||||
{
|
||||
private readonly IAllergenRepository _repo;
|
||||
public GetAllergenUseCase(IAllergenRepository repo) => _repo = repo;
|
||||
|
||||
public async Task<AllergenResponse?> ExecuteAsync(Guid id, CancellationToken ct = default)
|
||||
{
|
||||
var e = await _repo.GetAsync(id, ct);
|
||||
return e is null ? null : new AllergenResponse(e.Id, e.Scope, e.Code, e.Name, e.NameI18n, e.OverridesGlobalId, e.IsActive, e.IsSystem, e.Meta);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user