using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace VOL.Core.Utilities { //public static class AutoMapperExt //{ // /// // /// 类型映射 // /// // public static T MapTo(this object obj) // { // if (obj == null) return default(T); // Mapper.CreateMap(obj.GetType(), typeof(T)); // return Mapper.Map(obj); // } // /// // /// 集合列表类型映射 // /// // public static List MapToList(this IEnumerable source) // { // foreach (var first in source) // { // var type = first.GetType(); // Mapper.CreateMap(type, typeof(TDestination)); // break; // } // return Mapper.Map>(source); // } // /// // /// 集合列表类型映射 // /// // public static List MapToList(this IEnumerable source) // { // //IEnumerable 类型需要创建元素的映射 // Mapper.CreateMap(); // return Mapper.Map>(source); // } // /// // /// 类型映射 // /// // public static TDestination MapTo(this TSource source, TDestination destination) // where TSource : class // where TDestination : class // { // if (source == null) return destination; // Mapper.CreateMap(); // return Mapper.Map(source, destination); // } // /// // /// DataReader映射 // /// // public static IEnumerable DataReaderMapTo(this IDataReader reader) // { // Mapper.Reset(); // Mapper.CreateMap>(); // return Mapper.Map>(reader); // } //} }