refactor(core): DTOs und Services an Core 2.0.0.0 angepasst

This commit is contained in:
Developer 02
2024-09-20 00:53:28 +02:00
parent 8d88148b98
commit 9458ffae42
17 changed files with 39 additions and 44 deletions

View File

@@ -5,13 +5,12 @@ using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.UserManager.Infrastructure.Contracts;
using Microsoft.Extensions.Localization;
namespace DigitalData.UserManager.Application.Services
{
public class ModuleOfUserService : CRUDService<IModuleOfUserRepository, ModuleOfUserCreateDto, ModuleOfUserReadDto, ModuleOfUserUpdateDto, ModuleOfUser, int>, IModuleOfUserService
{
public ModuleOfUserService(IModuleOfUserRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper) : base(repository, mapper)
public ModuleOfUserService(IModuleOfUserRepository repository, IMapper mapper) : base(repository, mapper)
{
}
@@ -30,7 +29,7 @@ namespace DigitalData.UserManager.Application.Services
public async Task<DataResult<IEnumerable<ModuleOfUserReadDto>>> ReadByUserAsync(string username)
{
var mous = await _repository.ReadByUserAsync(username: username);
var mous_dtos = _mapper.MapOrThrow<IEnumerable<ModuleOfUserReadDto>>(mous);
var mous_dtos = _mapper.Map<IEnumerable<ModuleOfUserReadDto>>(mous);
return Result.Success(mous_dtos);
}
}