-
Hi, as I understood, a domain event is something which already happend, e.g. UserCreatedEvent. So, in my example I want to create a "UserProfile" entity after a "User" entity was created with added domain event "UserCreatedEvent", but when saving the "UserProfile" entity the id of the "User" entity is still empty as the events are triggered before the save into the database. Do I miss something or should the domain events triggered after save to database? Currently they are triggered before saving an entity to database. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ppslde, I understand your concern. I've adjusted the process: for |
Beta Was this translation helpful? Give feedback.
Hi @ppslde,
I understand your concern. I've adjusted the process: for
DeleteEvent
, theDispatchDomainEvents
first; for other events, it's done after saving to the database. Hope this helps.src/Infrastructure/Persistence/Interceptors/DispatchDomainEventsInterceptor.cs