Ejemplo n.º 1
0
        public static IEnumerable <TTarget> MapAll <TSource, TTarget>(this IEnumerable <TSource> source, IMappingRepository repo)
        {
            Guard.CheckArgumentNotNull(repo, "repo");
            var mapper = repo.ResolveMapper <TSource, TTarget>();

            return(MapAll <TSource, TTarget>(source, mapper));
        }
Ejemplo n.º 2
0
        public static TTarget MapTo <TTarget>(this object source, IMappingRepository repo)
        {
            Guard.CheckArgumentNotNull(source, "source");
            Guard.CheckArgumentNotNull(repo, "repo");
            var mapper = repo.ResolveMapper(source.GetType(), typeof(TTarget));

            return((TTarget)mapper.Map(source));
        }