Search code examples
aspnetboilerplate

Manually trigger an "after UoW" event


In the documentation it says that "EntitySavedEventData" will be automatically triggered after the UoW has completed. I want to make a custom event, which only happens after the changes have been saved to the database. I want to manually trigger the event only in some specific cases. How do I do this?


Solution

  • You can trigger after changes have been saved by adding an event handler like how ABP does it:

    _unitOfWorkManager.Current.Completed += (sender, args) =>
    {
        // Manually trigger the event only in some specific cases
    };