2

I'm trying to make emitmapper aware of hierarchies in my objects so it can select the most derived mapping for a class. Say that I have these classes

public class Payment { }
public class GuaranteePayment : Payment { }
public class CreditCardPayment: GuaranteePayment { }

And their respective DTOs (PaymentDTO, GuaranteePaymentDTO, etc) and the object I want to map has a collection of Payment, where each can any of the types deriving from Payment, including Payment itself, while the target is a DTO of that object with a collection of PaymentDTO of course. If I don't configure anything, emitmapper always creates and maps the base type. What is the best way to make it aware of the most derived type?

Ed Fox
  • 173
  • 1
  • 9

0 Answers0