Add project files.

This commit is contained in:
pkus
2025-01-24 13:37:01 +01:00
parent ee70a3c8af
commit ed726eea09
94 changed files with 4591 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
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<IEnumerable<ErrorLogDto>> GetAll()
{
return await context.ErrorLogs.Select(x => mapper.Map<ErrorLogDto>(x)).ToListAsync();
}
public async Task<IEnumerable<ErrorLogDto>> GetByOrderNumber(string customerOrderNumber)
{
return await context.ErrorLogs.Where(x => x.TrxNum == customerOrderNumber)
.Select(x => mapper.Map<ErrorLogDto>(x)).ToListAsync();
}
}
}