using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; using AutoMapper; using Server.Utils; namespace Server { /// /// 扩展 /// public static class AutoMapperEx { /// /// 绑定指定名字 /// /// /// /// /// /// public static void MapFromDynamic( this IMemberConfigurationExpression c, string memberName, Func resolverValue = null) { var resolver = new DynamicCustomResolver(memberName.Trim(' '), resolverValue); c.MapFrom(resolver); } public static IMappingExpression Ignore( this IMappingExpression map, Expression> selector) { map.ForMember(selector, config => config.Ignore()); return map; } } }