It\'s not so much a question, as I have found a way to do what I want, but it seems like there should be a better way to do it. I\'ve searched everywhere and not found anything.
I think if you are going to protect properties for good business logic reasons then it would be bad if AutoMapper circumvented them when doing its mapping. In situations like this I prefer to abandon the fluent syntax and place the creation logic in its own method like this:
private Parent MapParentDTOToParent(ParentDTO source)
{
var parent = new Parent();
// Business logic here
return parent
}
and then:
Mapper.CreateMap().ConvertUsing(MapParentDTOToParent);
I find this easier to follow than having lots of ignore declarations.