chore: Aktualisierte Core.Application
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user