14 lines
612 B
C#
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)));
|
|
}
|
|
} |