* Further improvements to generate Packing List

This commit is contained in:
2025-05-16 21:48:43 +02:00
parent da1eae8ca9
commit 55f7ed76fd
25 changed files with 474 additions and 198 deletions

View File

@@ -0,0 +1,21 @@
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using SytelineSaAppEfDataModel.Dtos;
using SytelineSaAppEfDataModel.Entities;
namespace SytelineSaAppEfDataModel.Services;
public class WzRowMeyleService(SytelineSaAppDbContext context, IMapper mapper) : IWzRowMeyleService
{
public async Task<IEnumerable<WzRowMeyleDto>> GetAll()
{
return await context.WzRowsMeyle.Select(x => mapper.Map<WzRowMeyleDto>(x)).ToListAsync();
}
public async Task CreateRows(IEnumerable<WzRowMeyleDto> rows)
{
var entities = mapper.Map<IEnumerable<WzRowMeyle>>(rows);
await context.WzRowsMeyle.AddRangeAsync(entities);
await context.SaveChangesAsync();
}
}