C
C#3y ago
bookuha

Where to map DTOs & Entities

1) Do I get DTO in controller, map it into an Entity and pass it to the handler (and map it to the dto once more to return it from action) or 2) Do this in handlers/services? Why? As I'm aware, no layer should reference presentation layer, where DTOs are located. But people keep telling me option 2 is more appropriate not specifying any reason
1 Reply
bookuha
bookuhaOP3y ago
Answered. I should place DTOs in new dedicated layer and use them in services. Makes most sense for me

Did you find this page helpful?