using AutoMapper; using DigitalData.Core.Abstractions.Application; using DigitalData.Core.Abstractions.Infrastructure; namespace DigitalData.Core.Application { /// /// Provides a concrete implementation of a basic CRUD service that uses a single Data Transfer Object (DTO) for all CRUD operations. /// This service simplifies the management of entities by utilizing a consistent object model throughout create, read, update, and delete operations. /// It extends the generic CRUDService by specifying the same DTO type for all generic parameters, facilitating a straightforward mapping between the entity and its data transfer representation. /// /// The Data Transfer Object type used for all operations. /// The entity type being managed by this service. /// The type of the identifier for the entity. /// /// This service is ideal for scenarios where a single DTO is adequate to represent the entity in all operations, /// reducing the need for multiple DTOs and simplifying the data mapping process. It leverages AutoMapper for object mapping /// and a culture-specific translation service for any necessary text translations, ensuring a versatile and internationalized approach to CRUD operations. /// public class BasicCRUDService : CRUDService, IBasicCRUDService where TCRUDRepository : ICRUDRepository where TDto : class where TEntity : class { /// /// Initializes a new instance of the BasicCRUDService with the specified repository, translation service, and AutoMapper configuration. /// /// The CRUD repository for accessing and manipulating entity data. /// The AutoMapper instance for mapping between DTOs and entities. public BasicCRUDService(TCRUDRepository repository, IMapper mapper) : base(repository, mapper) { } } }