autoMap<TSource extends AutoMapperModel, TTarget> method

TTarget autoMap<TSource extends AutoMapperModel, TTarget>(
  1. TSource source
)

Maps the source with auto map.

Implementation

TTarget autoMap<TSource extends AutoMapperModel, TTarget>(TSource source) {
  if (hasAutoMap(TTarget, TSource)) {
    return _autoMaps[TTarget]![TSource]!.map(source) as TTarget;
  }
  throw MapDoesNotExistError(TTarget, TSource);
}