* Added managing EdiCustomerOrderTranslations
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using AutoMapper;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using SytelineSaAppEfDataModel.Dtos;
|
||||
|
||||
namespace SytelineSaAppEfDataModel.Services;
|
||||
|
||||
public class EdiCustomerOrderTranslateService(SytelineSaAppDbContext context, IMapper mapper) : IEdiCustomerOrderTranslateService
|
||||
{
|
||||
public async Task<IEnumerable<EdiCustomerOrderTranslateDto>> GetAll()
|
||||
{
|
||||
return await context.EdiCustomerOrderTranslates.Select(x => mapper.Map<EdiCustomerOrderTranslateDto>(x))
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task Delete(int id)
|
||||
{
|
||||
var entity = await context.EdiCustomerOrderTranslates.FindAsync(id);
|
||||
if (entity != null)
|
||||
{
|
||||
context.EdiCustomerOrderTranslates.Remove(entity);
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user