I use this extension method:
public static IMappingExpression<TSource, TDestination> IgnoreMember<TSource, TDestination>( this IMappingExpression<TSource, TDestination> map, Expression<Func<TDestination, object>> selector) { map.ForMember(selector, config => config.Ignore()); return map; }
and i use it like that
Mapper.CreateMap<MyType1, MyType2>().IgnoreMember(m => m.PropertyName);
Hope this helps.
source share