Suppose i have a source class:
public class Source
{
//Several properties that can be mapped to DerivedBase and its subclasses
}
And some d
NB! For those who are having issues with derived interfaces. AutoMapper does not support registering against derived interfaces. Only classes are handled.
To make it work, you have to change your type reference for CreateMap to the class instead of interface.
Example:
interface Interface1 {}
class Class1: Interface1 {}
interface Interface2: Interface1 {}
class Class2: Class1, Interface2 {}
CreateMap().IncludeAllDerived();
CreateMap();
Any mapping against Interface2 will only use the first CreateMap. You will have to identify the second as
CreateMap();