The timing of publishing for domain events using Mediatr #1028
Unanswered
thatdotnetguy
asked this question in
Q&A
Replies: 1 comment 3 replies
-
It's helpful because it ensure that if you're doing something with external side effects, that only occurs after the save has completed successfully. This way you don't send an email thanking the customer for their order and then fail to save the order, for example. I cover pre and post persistence events in episodes on weeklydevtips.com if you want more background. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I can't see why doing a savechanges interceptor to fire off the domain events is helpful or what it adds to an architecture as opposed to just publishing (eg await _mediator.Publish(domainEvent)) them from within the handler?
Beta Was this translation helpful? Give feedback.
All reactions