chore: Aktualisierte Core.Application

This commit is contained in:
Developer 02
2025-01-15 11:43:18 +01:00
parent 6fc8bdc964
commit b7f8ea1e8e
14 changed files with 19 additions and 19 deletions

View File

@@ -9,11 +9,10 @@ using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.Application.Services
{
public class BaseService<TCRUDRepository, TCreateDto, TReadDto, TUpdateDto, TBaseEntity> : CRUDService<TCRUDRepository, TCreateDto, TReadDto, TUpdateDto, TBaseEntity, int>, IBaseService<TCreateDto, TReadDto, TUpdateDto, TBaseEntity>
public class BaseService<TCRUDRepository, TCreateDto, TReadDto, TBaseEntity> : CRUDService<TCRUDRepository, TCreateDto, TReadDto, TBaseEntity, int>, IBaseService<TCreateDto, TReadDto, TBaseEntity>
where TCRUDRepository : ICRUDRepository<TBaseEntity, int>
where TCreateDto : BaseCreateDto
where TReadDto : class
where TUpdateDto : BaseUpdateDto
where TBaseEntity : BaseEntity
{
public BaseService(TCRUDRepository repository, IMapper mapper) : base(repository, mapper)
@@ -37,12 +36,13 @@ namespace DigitalData.UserManager.Application.Services
return await base.CreateAsync(createDto);
}
public override async Task<Result> UpdateAsync(TUpdateDto updateDto)
// made without generic type
public override async Task<Result> UpdateAsync<TUpdateDto>(TUpdateDto updateDto)
{
var user = await GetUserAsync();
if (user is not null)
if (user is not null && updateDto is BaseUpdateDto baseUpdateDto)
{
updateDto.ChangedWho = user.Username;
baseUpdateDto.ChangedWho = user.Username;
}
return await base.UpdateAsync(updateDto);