Developer 02 0bf8979a09 refactor: Einführung des IUnique<TId>-Interfaces für Entitäten und DTOs
- Aktualisiertes IBasicCRUDService-Interface, um Konsistenz bei einzigartigen Identifikatoren mit IUnique<TId> durchzusetzen
- DIExtensions-Methoden angepasst, um IUnique<TId>-Einschränkungen für DTOs und Entitäten einzuschließen
2024-09-13 16:30:52 +02:00

22 lines
1.4 KiB
C#

using DigitalData.Core.Abstractions.Infrastructure;
namespace DigitalData.Core.Abstractions.Application
{
/// <summary>
/// Implements a simplified CRUD service interface that uses a single Data Transfer Object (DTO) type for all CRUD operations,
/// streamlining the process for entities where the same DTO can be used for creating, reading, updating, and deleting entities.
/// This interface inherits from the ICRUDService interface, applying the same DTO type for all generic type parameters,
/// thereby simplifying the usage for cases where a single DTO is sufficient for all operations on an entity.
/// </summary>
/// <typeparam name="TDto">The type of the Data Transfer Object used for all CRUD operations.</typeparam>
/// <typeparam name="TEntity">The type of the entity this service maps to.</typeparam>
/// <typeparam name="TId">The type of the identifier for the entity.</typeparam>
/// <remarks>
/// This interface is useful for entities that do not require different DTOs for different operations,
/// allowing for a more concise and maintainable codebase when implementing services for such entities.
/// </remarks>
public interface IBasicCRUDService<TDto, TEntity, TId> : ICRUDService<TDto, TDto, TDto, TEntity, TId>
where TDto : class, IUnique<TId> where TEntity : class, IUnique<TId>
{
}
}