Files
FA_WEB/SytelineSaAppEfDataModel/Services/VatCodeAssociationService.cs
2025-08-22 07:01:13 +02:00

14 lines
612 B
C#

using AutoMapper;
using SytelineSaAppEfDataModel.Dtos;
namespace SytelineSaAppEfDataModel.Services;
public class VatCodeAssociationService(SytelineSaAppDbContext context, IMapper mapper) : IVatCodeAssociationService
{
public async Task<VatCodeAssociationDto?> GetVatCodesAssociation(string customerDoInvoice, string endUserType,
string productCode)
{
return await Task.FromResult(mapper.Map<VatCodeAssociationDto?>(context.VatCodeAssociations.FirstOrDefault(x =>
x.VATRegisterType == customerDoInvoice && x.EndUserType == endUserType && x.ProdCode == productCode)));
}
}