Пример #1
0
        //create a new target and map source on it
        public static TTarget Map <TSource, TTarget>(TSource source)
        {
            var target = (TTarget)Creator.Create(typeof(TTarget));

            return(MapperFactory.GetMapper <TSource, TTarget>().Map(source, target));
        }
Пример #2
0
 public void End()
 {
     MapperFactory.ClearMappers();
 }
Пример #3
0
 //map source to an existing target
 public static TTarget Map <TSource, TTarget>(TSource source, TTarget target)
 {
     target = MapperFactory.GetMapper <TSource, TTarget>().Map(source, target);
     return(target);
 }