尝试根据 viewModel 上的特定字段跳过属性映射。有什么方法可以访问 ForAllMembers -> Condition 方法中的源对象
Mapper.CreateMap<AViewModel, AEntity>()
.IgnoreMembers(ignoreMembers)
.ForAllMembers(o => {
o.Condition(ctx => {
//Need to access AViewModel instance here
return "Id" == ctx.MemberName;
});
});