using DigitalData.Core.DTO; namespace DigitalData.Core.Abstractions.Application { public interface IReadService where TReadDto : class where TEntity : class, IUnique { /// /// Retrieves an entity by its identifier and returns its readDTO representation wrapped in an IServiceResult, /// including the readDTO on success or null and an error message on failure. /// /// The identifier of the entity to retrieve. /// An DataResult containing the readDTO representing the found entity or null, with an appropriate message. Task> ReadByIdAsync(TId id); /// /// Retrieves all entities and returns their readDTO representations wrapped in an IServiceResult, /// including a collection of readDTOs on success or an error message on failure. /// /// An DataResult containing a collection of readDTOs representing all entities or an error message. Task>> ReadAllAsync(); /// /// Deletes an entity by its identifier and returns the result wrapped in an IServiceMessage, /// indicating the success or failure of the operation, including the error messages on failure. /// /// The identifier of the entity to delete. /// An Result indicating the outcome of the delete operation, with an appropriate message. Task DeleteAsyncById(TId id); /// /// Asynchronously checks if an entity with the specified identifier exists within the data store. /// /// The identifier of the entity to check. /// A task that represents the asynchronous operation. The task result contains a boolean value indicating whether the entity exists. Task HasEntity(TId id); } }