|
|
@ -49,6 +49,22 @@ public abstract class AbstractKeyReadOnlyAppService<TEntity, TGetOutputDto, TGet |
|
|
ReadOnlyRepository = repository; |
|
|
ReadOnlyRepository = repository; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public virtual async Task<bool> ExistsAsync(TKey id) |
|
|
|
|
|
{ |
|
|
|
|
|
await CheckGetPolicyAsync(); |
|
|
|
|
|
|
|
|
|
|
|
return await ExistAsync(id); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public virtual async Task<TGetListOutputDto?> FindAsync(TKey id) |
|
|
|
|
|
{ |
|
|
|
|
|
await CheckGetPolicyAsync(); |
|
|
|
|
|
|
|
|
|
|
|
var entity = await FindEntityByIdAsync(id); |
|
|
|
|
|
|
|
|
|
|
|
return entity == null ? default : await MapToGetListOutputDtoAsync(entity); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public virtual async Task<TGetOutputDto> GetAsync(TKey id) |
|
|
public virtual async Task<TGetOutputDto> GetAsync(TKey id) |
|
|
{ |
|
|
{ |
|
|
await CheckGetPolicyAsync(); |
|
|
await CheckGetPolicyAsync(); |
|
|
@ -83,6 +99,10 @@ public abstract class AbstractKeyReadOnlyAppService<TEntity, TGetOutputDto, TGet |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected abstract Task<bool> ExistAsync(TKey id); |
|
|
|
|
|
|
|
|
|
|
|
protected abstract Task<TEntity?> FindEntityByIdAsync(TKey id); |
|
|
|
|
|
|
|
|
protected abstract Task<TEntity> GetEntityByIdAsync(TKey id); |
|
|
protected abstract Task<TEntity> GetEntityByIdAsync(TKey id); |
|
|
|
|
|
|
|
|
protected virtual async Task CheckGetPolicyAsync() |
|
|
protected virtual async Task CheckGetPolicyAsync() |
|
|
|