Library for using AutoMapper with GodelTech.Business
GodelTech.Business.AutoMapper
implements GodelTech.Business IBusinessMapper
interface using AutoMapper NuGet package. It allows to use mapping of TSource
to TDestination
.
public class BusinessMapper : IBusinessMapper
{
private readonly IMapper _mapper;
public BusinessMapper(IMapper mapper)
{
_mapper = mapper;
}
public TDestination Map<TSource, TDestination>(TSource source)
{
return _mapper.Map<TSource, TDestination>(source);
}
public TDestination Map<TSource, TDestination>(TSource source, TDestination destination)
{
return _mapper.Map(source, destination);
}
}