refactor: ICRUDService, CRUDService, CRUDRepository und ICRUDRepository um IUnique<TId> Einschränkung zu erzwingen

- `IUnique<TId>` Einschränkung zu `TEntity` in den Schnittstellen `ICRUDService`, `CRUDService`, `ICRUDRepository` und `CRUDRepository` hinzugefügt.
- Relevanten Code aktualisiert, um die neue Einschränkung zu berücksichtigen und sicherzustellen, dass Entitäten `IUnique<TId>` implementieren.
This commit is contained in:
Developer 02
2024-09-11 09:54:26 +02:00
parent b6cd520b72
commit a6230419d8
4 changed files with 6 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ using DigitalData.Core.DTO;
namespace DigitalData.Core.Abstractions.Application
{
public interface ICRUDService<TCreateDto, TReadDto, TUpdateDto, TEntity, TId>
where TCreateDto : class where TReadDto : class where TUpdateDto : IUnique<TId> where TEntity : class
where TCreateDto : class where TReadDto : class where TUpdateDto : IUnique<TId> where TEntity : class, IUnique<TId>
{
Task<DataResult<TId>> CreateAsync(TCreateDto createDto);

View File

@@ -5,7 +5,7 @@
/// </summary>
/// <typeparam name="TEntity">The type of the entity this repository works with.</typeparam>
/// <typeparam name="TId">The type of the identifier for the entity.</typeparam>
public interface ICRUDRepository<TEntity, TId> where TEntity : class
public interface ICRUDRepository<TEntity, TId> where TEntity : class, IUnique<TId>
{
/// <summary>
/// Adds a new entity to the repository.