namespace DigitalData.Core.Abstractions.Infrastructure
{
///
/// 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 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 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);
}
}