* Introduced Marelli packing list
This commit is contained in:
@@ -4,8 +4,8 @@ namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public interface IWzRowMareliService
|
||||
{
|
||||
Task<IEnumerable<WzRowMareliDto>> GetAll();
|
||||
Task CreateRows(IEnumerable<WzRowMareliDto> rows);
|
||||
Task<IEnumerable<WzRowMareliDto>> GetByWzHeaderId(Guid wzHeaderId);
|
||||
Task UpdateRows(IEnumerable<WzRowMareliDto> rows);
|
||||
Task<IEnumerable<WzRowMarelliDto>> GetAll();
|
||||
Task CreateRows(IEnumerable<WzRowMarelliDto> rows);
|
||||
Task<IEnumerable<WzRowMarelliDto>> GetByWzHeaderId(Guid wzHeaderId);
|
||||
Task UpdateRows(IEnumerable<WzRowMarelliDto> rows);
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user