DTO: multiple DTOs (and assemblers) for the same resource

I often need, depending on the case, several DTOs for the same resource.

Take an example of photo albums. Depending on what I want to display, I need different data in my DTOs (creation via form, list, details, etc.).

I will have albumFormDTO to create an album, an albumDTO collection for an album list, and a DetailedDTO album for a detailed album.

For everyone, I need a specific assembler. It seems really hard to do this.

Does this sound silly?

Thank you, Qia Benjamin.

+3
source share
2 answers

No, that doesn't sound silly.

, , -dto, . .

, dto , , . .

+1

DTO, , ​​ ModelMapper, .

http://modelmapper.org

0

Source: https://habr.com/ru/post/1729680/


All Articles