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:
@@ -1,3 +1,4 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -19,8 +20,8 @@ namespace DigitalData.Core.API
|
||||
where TCRUDService : ICRUDService<TCreateDto, TReadDto, TUpdateDto, TEntity, TId>
|
||||
where TCreateDto : class
|
||||
where TReadDto : class
|
||||
where TUpdateDto : class
|
||||
where TEntity : class
|
||||
where TUpdateDto : class, IUnique<TId>
|
||||
where TEntity : class, IUnique<TId>
|
||||
{
|
||||
protected readonly ILogger _logger;
|
||||
protected readonly TCRUDService _service;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -20,8 +21,8 @@ namespace DigitalData.Core.API
|
||||
where TCRUDService : ICRUDService<TCreateDto, TReadDto, TUpdateDto, TEntity, TId>
|
||||
where TCreateDto : class
|
||||
where TReadDto : class
|
||||
where TUpdateDto : class
|
||||
where TEntity : class
|
||||
where TUpdateDto : class, IUnique<TId>
|
||||
where TEntity : class, IUnique<TId>
|
||||
{
|
||||
protected readonly ILogger _logger;
|
||||
protected readonly TCRUDService _service;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -13,13 +12,13 @@ namespace DigitalData.Core.API
|
||||
/// <typeparam name="TId">The type of the entity's identifier.</typeparam>
|
||||
[ApiController]
|
||||
[Route("api/[controller]")]
|
||||
public class ReadControllerBase<TBasicCRUDService, TReadDto, TEntity, TId> : ControllerBase
|
||||
where TBasicCRUDService : IBasicCRUDService<TReadDto, TEntity, TId>
|
||||
public class ReadControllerBase<TReadService, TReadDto, TEntity, TId> : ControllerBase
|
||||
where TReadService : IReadService<TReadDto, TEntity, TId>
|
||||
where TReadDto : class
|
||||
where TEntity : class, IUnique<TId>
|
||||
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 +27,7 @@ namespace DigitalData.Core.API
|
||||
/// <param name="service">The CRUD service handling business logic for the entity.</param>
|
||||
public ReadControllerBase(
|
||||
ILogger logger,
|
||||
TBasicCRUDService service)
|
||||
TReadService service)
|
||||
{
|
||||
_logger = logger;
|
||||
_service = service;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user