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 { public class ErrorLogService(SytelineSaAppDbContext context, IMapper mapper) : IErrorLogService { public async Task> GetAll() { return await context.ErrorLogs.Select(x => mapper.Map(x)).ToListAsync(); } public async Task> GetByOrderNumber(string customerOrderNumber) { return await context.ErrorLogs.Where(x => x.TrxNum == customerOrderNumber) .Select(x => mapper.Map(x)).ToListAsync(); } } }