Is there like a helper function available or how do you write a helper function like that to avoid having to do this?
m
mkporwit
07/10/2018, 9:25 PM
You should be able to write something like this:
Copy code
fun Food.toDTO(): DTOFood {
return DTOFood(id=this.id, ...)
}
a
Alan Lee
07/10/2018, 9:35 PM
I cannot really say without looking at the details but if they have the exact same parameters, may be you could just include the class in the other class instead of copying all the fields over.