public IMemberConfiguration <T, TN> Ignore <TMember>(Expression <Func <TN, TMember> > dest) { if (dest == null) { throw new ArgumentNullException("dest"); } if (!(dest.Body is MemberExpression)) { throw new Exception("MemberExpression should return one of the properties of destination class"); } _typeMapper.Ignore(dest); return(this); }
/// <summary> /// Ignore the members during mapping. /// </summary> /// <typeparam name="TSource">The source type.</typeparam> /// <typeparam name="TTarget">The target type.</typeparam> /// <param name="typeMapper">The type mapping strategy.</param> /// <param name="members">The member names to ignore during mapping.</param> /// <returns>The type mapping strategy.</returns> public static ITypeMapper <TSource, TTarget> Ignore <TSource, TTarget>( this ITypeMapper <TSource, TTarget> typeMapper, params string[] members) { return(typeMapper.Ignore(members)); }
/// <summary> /// Ignore the specified member during mapping. /// </summary> /// <typeparam name="TSource">The source type.</typeparam> /// <typeparam name="TTarget">The target type.</typeparam> /// <typeparam name="TMember">The type of the member to ignore during mapping of the target.</typeparam> /// <param name="typeMapper">The type mapping strategy.</param> /// <param name="expression">The expression of the target member to ignore during mapping.</param> /// <returns>The type mapping strategy.</returns> public static ITypeMapper <TSource, TTarget> Ignore <TSource, TTarget, TMember>( this ITypeMapper <TSource, TTarget> typeMapper, Expression <Func <TTarget, TMember> > expression) { return(typeMapper.Ignore(ExtractMember(expression).Member.Name)); }