Instance variable of destination object is mapped to super type, and not sub type of the source object

Skip to first unread message

Wayne Tech

Sep 11, 2018, 4:14:00 PM9/11/18
to modelmapper

My source object and destination object are actually identical in terms of the attributes/variables. However, one variable is a super type and at run time, it will be a sub type.

I have a source object with the variable as a specific sub type on run time, and when I was trying to map the source object to the destination object, it complained about the  the super type with on no argument and public constructor. I had to make the super type a concrete class and then the destination object can be created/mapped. However, the instance variable of the destination object is now super type.

I tried to use typemap to list the super type and all the sub types. However, the problem remains.

Is there any special configuration that can help?


Reply all
Reply to author
0 new messages