* Removed not needed code
* Changed string parameters to GUID
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user