using AutoMapper; using Microsoft.EntityFrameworkCore; using SytelineSaAppEfDataModel.Dtos; namespace SytelineSaAppEfDataModel.Services; public class WzClientService(SytelineSaAppDbContext context, IMapper mapper) : IWzClientService { public async Task> GetAll() { return await context.WzClients.Select(x => mapper.Map(x)).ToListAsync(); } public async Task GetById(Guid id) { var entity = await context.WzClients.FirstOrDefaultAsync(x => x.ID == id); return entity == null ? null : mapper.Map(entity); } }