* Removed not needed code

* Changed string parameters to GUID
This commit is contained in:
2025-02-01 07:21:57 +01:00
parent 98777328d7
commit 51f5c09d82
4 changed files with 15 additions and 19 deletions

View File

@@ -1,10 +1,5 @@
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SytelineSaAppEfDataModel.Dtos;
namespace SytelineSaAppEfDataModel.Services
@@ -18,8 +13,13 @@ namespace SytelineSaAppEfDataModel.Services
public async Task<IEnumerable<ErrorLogDto>> GetByOrderNumber(Guid customerOrderNumber)
{
return await context.ErrorLogs.Where(x => x.TrxNum == customerOrderNumber)
EdiCustomerOrderDto ediCustomerOrderDto = mapper.Map<EdiCustomerOrderDto>(
await context.EdiCustomerOrders.FirstOrDefaultAsync(x => x.RowPointer.Equals(customerOrderNumber)));
if (ediCustomerOrderDto == null) return [];
return await context.ErrorLogs.Where(x => x.TrxNum == ediCustomerOrderDto.CustomerOrderNumber)
.Select(x => mapper.Map<ErrorLogDto>(x)).ToListAsync();
}
}
}
}