using AutoMapper; using DigitalData.Core.Abstractions.Infrastructure; namespace DigitalData.Core.Infrastructure.AutoMapper; public class EntityAutoMapper : IEntityMapper { private readonly IMapper _rootMapper; public EntityAutoMapper(IMapper rootMapper) { _rootMapper = rootMapper; } public TDto Map(TEntity entity) => _rootMapper.Map(entity); public TEntity Map(TDto dto) => _rootMapper.Map(dto); public TEntity Map(TDto dto, TEntity entity) => _rootMapper.Map(dto, entity); }