MediatR what is the proper way to combine multiple commands in one #776
MilkoEmanuilov
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use MediatR and everything looks good but i'm not sure what is the proper way to reuse the commands.
For example if I have a TodoListEntity a command (CreateTodoListCommand).
Everything is clear for now but what if I want to reuse this command and trigger some different behaviour.
For example i have two Todo forms.
When the form is triggered from AdminController only save in database is triggered. That should be ok.
I have a second form that is triggered from UserController. When customer fills the form I want to be created a record in the database, save some other information in another database table, and send email to the customer.
What is the proper way to reuse CreateTodoListCommand and combine it with other commands?
Create new command CreateTodoListFromUserControllerCommand which contains something like this?
Or there is something better than this?
Beta Was this translation helpful? Give feedback.
All reactions