I want to use automapper to map between my public data contracts and my DB models. I have created a class which automatically goes through all the contracts are creates mapp
For newer versions that utilize the Instance API, use this instead:
var mappingConfig = new MapperConfiguration(cfg =>
{
cfg.CreateMap().ForAllMembers(opt => opt.Condition(
(source, destination, sourceMember, destMember) => (sourceMember != null)));
});
Note: This functionality works as of 5.0.2, breaking on later versions as of this writing. Waiting for the next 5.2.x release is recommended if upgrading from 5.0.2.