I am having an issue using AutoMapper (which is an excellent technology) to map a business object to a DTO where I have inheritance off of an abstract base class within a co
This answer comes 'a bit' late as I've just faced the same issue with EF4 POCO proxies.
I solved it using a custom converter that calls Mapper.DynamicMap to invoke the runtime type conversion, rather than the .Include.
It works fine for me.
In your case you would define the following converter:
class PaymentConverter : ITypeConverter {
public DtoPayment Convert( ResolutionContext context ) {
return Mapper.DynamicMap( context.SourceValue );
}
}
And then:
Mapper.CreateMap().ConvertUsing();
Mapper.CreateMap();
Mapper.CreateMap();