Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="source"></typeparam>
        /// <typeparam name="taget"></typeparam>
        /// <param name="sourceList"></param>
        /// <returns></returns>
        public static List <taget> ObjectListMap <source, taget>(List <source> sourceList) where taget : class
        {
            List <taget> itemList = new List <taget>();

            itemList = AutoMapperEx.MapToList <taget>(sourceList);

            return(itemList);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 单个实体映射
        /// </summary>
        /// <typeparam name="source"></typeparam>
        /// <typeparam name="taget"></typeparam>
        /// <param name="sourceList"></param>
        /// <returns></returns>
        public static taget ObjectMap <source, taget>(source sourceItem) where taget : class
        {
            taget item = AutoMapperEx.MapTo <taget>(sourceItem);

            return(item);
        }