Library for using AutoMapper with GodelTech.Data.
GodelTech.Data.AutoMapper
implements GodelTech.Data IDataMapper
interface using AutoMapper NuGet package. It allows to use mapping of TEntity
to TModel
.
public class DataMapper : IDataMapper
{
private readonly IMapper _mapper;
public DataMapper(IMapper mapper)
{
_mapper = mapper;
}
public IQueryable<TDestination> Map<TDestination>(IQueryable source)
{
return _mapper.ProjectTo<TDestination>(source);
}
}