Inferring destination type from interface with AutoMapper
I'm trying to implement some cross-cutting concerns in my application, which uses AutoMapper to map between different DTOs/message objects. Say I have this: configuration.Map<MyMessage, MyEvent>() . MyEvent implements IEvent (which is a marker interface with no properties). Is there any way to ask AutoMapper to map a MyMessage to IEvent , and have it infer that "oh, I have a mapping MyMessage to MyEvent , and MyEvent implements IEvent "? This (invalid) example shows what I want to achieve: // IEvent is just a marker interface with no properties, // and is implemented by all of the *Event