Hi,
Is it possible to publish multiple commands to the CommandBus, or wrap the CommandBus up in some sort of transaction?
Reason
Say I have a User aggregate and I've modeled the domain nicely and have certain commands such as UpdateName(), AddAddress(), UpdateDob() etc.
However, the UI implementation of this has put all of those fields on a single form and just does a single PUT with all the data to my api. I would like my API layer to handle what commands should be called based on the user input and raise the publish the commands accordingly. I would like to keep the domain as it is (based on the domain, not the UI implementation).
Say I publish 3 commands but the third one fails (could be business logic etc) then I don't want any of the events to be saved. How can I publish multiple commands but only save the events etc when all of them are completed?
Thanks
Hi,
Is it possible to publish multiple commands to the CommandBus, or wrap the CommandBus up in some sort of transaction?
Reason
Say I have a User aggregate and I've modeled the domain nicely and have certain commands such as
UpdateName(),AddAddress(),UpdateDob()etc.However, the UI implementation of this has put all of those fields on a single form and just does a single PUT with all the data to my api. I would like my API layer to handle what commands should be called based on the user input and raise the publish the commands accordingly. I would like to keep the domain as it is (based on the domain, not the UI implementation).
Say I publish 3 commands but the third one fails (could be business logic etc) then I don't want any of the events to be saved. How can I publish multiple commands but only save the events etc when all of them are completed?
Thanks