spaisey
07/26/2018, 7:05 AMfun Person.toDto() = PersonDto("${firstName} ${lastName}")
. You can then call person.toDto(). The Extension function lives outside the Person class (say, in Extensions.kt) in the same package as the DTO class.Gokul
07/26/2018, 7:07 AMentity
had to know details of the DTO
. So i finally moved that logic to a mapper that does the required mapping between them.spaisey
07/26/2018, 7:09 AMGokul
07/26/2018, 11:24 PM