namespace DigitalData.Core.Abstraction.Application.Repository { /// /// Defines methods for mapping between entities and Data Transfer Objects (DTOs). /// /// The type of the entity to be mapped. public interface IEntityMapper { /// /// Maps an entity to a DTO. /// /// The type of the DTO to map to. /// The entity to be mapped. /// The mapped DTO. TDto Map(TEntity entity); /// /// Maps an entity list to a DTO list. /// /// The type of the DTO to map to. /// The entity list to be mapped. /// The mapped DTO list. IEnumerable Map(IEnumerable entities); /// /// Maps a DTO to an entity. /// /// The type of the DTO to be mapped. /// The DTO to be mapped. /// The mapped entity. TEntity Map(TDto dto); /// /// Maps a DTO list to an entity list. /// /// The type of the DTO to be mapped. /// The DTO list to be mapped. /// The mapped entity list. IEnumerable Map(IEnumerable dtos); /// /// Maps a DTO to an existing entity. /// /// The type of the DTO to be mapped. /// The DTO to be mapped. /// The existing entity to be updated with the mapped values. /// The updated entity. TEntity Map(TDto dto, TEntity entity); } }