feat: ReadService hinzugefügt und in ReadController integriert

- Generischen ReadService erstellt, um Lese- (ReadById, ReadAll) und Löschoperationen zu verwalten.
- ReadService in den ReadController integriert.
This commit is contained in:
Developer 02
2024-09-16 09:08:27 +02:00
parent 2c739fbf02
commit 993d407a48
8 changed files with 97 additions and 91 deletions

View File

@@ -13,13 +13,13 @@ namespace DigitalData.Core.API
/// <typeparam name="TId">The type of the entity's identifier.</typeparam>
[ApiController]
[Route("api/[controller]")]
public class ReadControllerBaseWithErrorHandling<TBasicCRUDService, TReadDto, TEntity, TId> : ControllerBase
where TBasicCRUDService : IBasicCRUDService<TReadDto, TEntity, TId>
public class ReadControllerBaseWithErrorHandling<TReadService, TReadDto, TEntity, TId> : ControllerBase
where TReadService : IReadService<TReadDto, TEntity, TId>
where TReadDto : class
where TEntity : class
{
protected readonly ILogger _logger;
protected readonly TBasicCRUDService _service;
protected readonly TReadService _service;
/// <summary>
/// Initializes a new instance of the CRUDControllerBase class with specified logger and CRUD service.
@@ -28,7 +28,7 @@ namespace DigitalData.Core.API
/// <param name="service">The CRUD service handling business logic for the entity.</param>
public ReadControllerBaseWithErrorHandling(
ILogger logger,
TBasicCRUDService service)
TReadService service)
{
_logger = logger;
_service = service;