CQRS with Rest API #457
-
I'm learning Clean Architecture and what I found confusing is the CQRS Update Command with Rest API. I check the So how can I have an update request using |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @NghiaNguyen170192 |
Beta Was this translation helpful? Give feedback.
-
As @andrewtsw mentioned, it is the same approach which @vkhorikov wrote in his article https://enterprisecraftsmanship.com/posts/cqrs-commands-part-domain-model/ |
Beta Was this translation helpful? Give feedback.
Hi @NghiaNguyen170192
I believe the best way to fix it - do not use commands as a DTO.
Co, create
UpdateTodoListDto
withoutid
and use it as a parameter of the controller method.Then create a command and put
id
and DTO to it. And a command send to handler.So no
id
duplication.What do you think about this approach?