/// <summary> /// Tells AutoMapper to ignore mapping for a specified property of the source /// type, with a less verbose syntax than the out-of-the-box AutoMapper /// syntax. Instead of: /// <![CDATA[ /// .ForMember(dest => dest.PropertyName, opt => opt.Ignore()) /// ]]> /// ...or: /// <![CDATA[ /// .ForMember(dest => dest.PropertyName).Ignore() /// ]]> /// ...you can code: /// <![CDATA[ /// .IgnoreMember(dest => dest.PropertyName) /// ]]> /// </summary> /// <typeparam name="TSource">Source ("map from") type.</typeparam> /// <typeparam name="TDestination">Destination ("map to") type.</typeparam> /// <param name="mappingExpression"> /// AutoMapper <see cref="IMappingExpression{TSource, TDestination}"/> instance. /// </param> /// <param name="member"> /// Expression for a function that takes an instance of the destination type and /// returns an object. /// </param> /// <returns> /// Updated <see cref="IMappingExpression{TSource, TDestination}"/> instance, which can /// be used for fluent chaining of more mapping methods. /// </returns> /// <example> /// <![CDATA[ /// Mapper.Initialize(cfg => /// cfg.CreateMap<Foo, Bar>() /// .IgnoreMember(dest => dest.Baz); /// ]]> /// </example> public static IMappingExpression <TSource, TDestination> IgnoreMember <TSource, TDestination>( this IMappingExpression <TSource, TDestination> mappingExpression, Expression <Func <TDestination, object> > member) { return(mappingExpression.IgnoreMembers(member)); }