refactor: IUnique<TId>-Einschränkungen in den Basis-Controller-Klassen durchsetzen
- Aktualisiert ReadControllerBase, um zu verlangen, dass TEntity IUnique<TId> implementiert - BasicCRUDControllerBase geändert, um sicherzustellen, dass sowohl TDto als auch TEntity IUnique<TId> implementieren
This commit is contained in:
parent
0bf8979a09
commit
dcd54266c0
@ -1,5 +1,5 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.Abstractions.Infrastructure;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DigitalData.Core.API
|
||||
@ -8,8 +8,8 @@ namespace DigitalData.Core.API
|
||||
[Route("api/[controller]")]
|
||||
public class BasicCRUDControllerBase<TCRUDService, TDto, TEntity, TId> : CRUDControllerBase<TCRUDService, TDto, TDto, TDto, TEntity, TId>
|
||||
where TCRUDService : ICRUDService<TDto, TDto, TDto, TEntity, TId>
|
||||
where TDto : class
|
||||
where TEntity : class
|
||||
where TDto : class, IUnique<TId>
|
||||
where TEntity : class, IUnique<TId>
|
||||
{
|
||||
public BasicCRUDControllerBase(ILogger logger, TCRUDService service) : base(logger, service)
|
||||
{
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
using DigitalData.Core.Abstractions;
|
||||
using DigitalData.Core.Abstractions.Application;
|
||||
using DigitalData.Core.DTO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@ -15,7 +16,7 @@ namespace DigitalData.Core.API
|
||||
public class ReadControllerBase<TBasicCRUDService, TReadDto, TEntity, TId> : ControllerBase
|
||||
where TBasicCRUDService : IBasicCRUDService<TReadDto, TEntity, TId>
|
||||
where TReadDto : class
|
||||
where TEntity : class
|
||||
where TEntity : class, IUnique<TId>
|
||||
{
|
||||
protected readonly ILogger _logger;
|
||||
protected readonly TBasicCRUDService _service;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user