* Created Entities, Dtos and Mapping for WzClient and WzHeader

This commit is contained in:
2025-05-07 21:21:02 +02:00
parent 9f38998135
commit 1f08ae05f0
12 changed files with 215 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
using SytelineSaAppEfDataModel.Dtos;
namespace SytelineSaAppEfDataModel.Services;
public interface IWzClientService
{
Task<IEnumerable<WzClientDto>> GetAll();
}

View File

@@ -0,0 +1,8 @@
using SytelineSaAppEfDataModel.Dtos;
namespace SytelineSaAppEfDataModel.Services;
public interface IWzHeaderService
{
Task<IEnumerable<WzHeaderDto>> GetAll();
}

View File

@@ -0,0 +1,13 @@
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using SytelineSaAppEfDataModel.Dtos;
namespace SytelineSaAppEfDataModel.Services;
public class WzClientService(SytelineSaAppDbContext context, IMapper mapper) : IWzClientService
{
public async Task<IEnumerable<WzClientDto>> GetAll()
{
return await context.WzClients.Select(x => mapper.Map<WzClientDto>(x)).ToListAsync();
}
}

View File

@@ -0,0 +1,13 @@
using AutoMapper;
using Microsoft.EntityFrameworkCore;
using SytelineSaAppEfDataModel.Dtos;
namespace SytelineSaAppEfDataModel.Services;
public class WzHeaderService(SytelineSaAppDbContext context, IMapper mapper) : IWzHeaderService
{
public async Task<IEnumerable<WzHeaderDto>> GetAll()
{
return await context.WzHeaders.Select(x => mapper.Map<WzHeaderDto>(x)).ToListAsync();
}
}