'Replacement for Automapper's ForAllOtherMembers()

ForAllOtherMembers extension method was removed from Automapper 11 I use it to ignore conventional mappings for properties other than the one mentioned before like this

ForAllOtherMembers(opt=>opt.ignore())

How to do this in Automapper 11 ?



Solution 1:[1]

You can set this on the CreateMap call:

CreateMap<TSource, TDest>(MemberList.None)

Solution 2:[2]

From the AutoMapper 11.0 Upgrade Guide:

ForAllOtherMembers was removed

That was used to disable mapping by convention, not something we want to support. When only used for validation, it can be replaced with MemberList.None.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Felix Planjer
Solution 2 Bernard Vander Beken