Open Closed

Auto-Generated Code Deletes Custom DeletedEventHandler #9129


User avatar
0
digitalservicegb created
  • ABP Suite Version : 9.1.0
    image.png

Hi ABP Support Team,

While updating my "Transaction" entity, I noticed that ABP's auto-generated CRUD code removes my custom TransactionDeletedEventHandler. However, my other custom event handlers — TransactionCreatedEventHandler and TransactionUpdatedEventHandler — are not affected.

I suspect this might be because when ABP regenerates the DeletedEventHandler for the master entity, it searches for all files containing the term “DeletedEventHandler” and deletes them. This could have unintentionally removed my own TransactionDeletedEventHandler.

To confirm this, I renamed my file from TransactionDeletedEventHandler to TransactionDeleteEventHandler (removing the last “d” in “Deleted”), and after doing so, ABP no longer deletes the file during code regeneration.

Could you please help me check if this might be an issue?

Thank you!


1 Answer(s)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    Hi, thanks for the detailed information.

    You are right that ABP Suite, searches for all files containing the term "{EntityName}DeletedEventHandler" and then re-generates it for the master entity. To overcome this problem, as you stated, it can be good to create a new deleted event handler with a different name.

    Thanks for clearing out the possible problem, I'll create an internal issue for that and we will evaluate it and also notice that I've refunded your ticket.

    Best Regards.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 16, 2025, 12:13