* Introduced Marelli packing list

This commit is contained in:
2025-09-09 07:00:05 +02:00
parent 89792d3d28
commit 50a25ff996
12 changed files with 477 additions and 30 deletions

View File

@@ -7,29 +7,29 @@ namespace SytelineSaAppEfDataModel.Services;
public class WzRowMareliService(SytelineSaAppDbContext context, IMapper mapper) : IWzRowMareliService
{
public async Task<IEnumerable<WzRowMareliDto>> GetAll()
public async Task<IEnumerable<WzRowMarelliDto>> GetAll()
{
return await context.WzRowsMeyle.Select(x => mapper.Map<WzRowMareliDto>(x)).ToListAsync();
return await context.WzRowsMeyle.Select(x => mapper.Map<WzRowMarelliDto>(x)).ToListAsync();
}
public async Task CreateRows(IEnumerable<WzRowMareliDto> rows)
public async Task CreateRows(IEnumerable<WzRowMarelliDto> rows)
{
var entities = mapper.Map<IEnumerable<WzRowMareli>>(rows);
var entities = mapper.Map<IEnumerable<WzRowMarelli>>(rows);
await context.WzRowsMareli.AddRangeAsync(entities);
await context.SaveChangesAsync();
}
public async Task<IEnumerable<WzRowMareliDto>> GetByWzHeaderId(Guid wzHeaderId)
public async Task<IEnumerable<WzRowMarelliDto>> GetByWzHeaderId(Guid wzHeaderId)
{
return await context.WzRowsMareli
.Where(x => x.FKHeader == wzHeaderId)
.Select(x => mapper.Map<WzRowMareliDto>(x))
.Select(x => mapper.Map<WzRowMarelliDto>(x))
.ToListAsync();
}
public async Task UpdateRows(IEnumerable<WzRowMareliDto> rows)
public async Task UpdateRows(IEnumerable<WzRowMarelliDto> rows)
{
var entities = mapper.Map<IEnumerable<WzRowMareli>>(rows);
var entities = mapper.Map<IEnumerable<WzRowMarelli>>(rows);
context.WzRowsMareli.UpdateRange(entities);
await context.SaveChangesAsync();
}