AfterDelete?

Posts   
 
    
ChBaeumer
User
Posts: 175
Joined: 23-Oct-2003
# Posted on: 09-Jun-2008 15:11:39   

Hello,

is it possible to have an AfterDelete event for an entity like the AfterSave event?

In my business logic I have few classes, which cache some data which do not often change.

I can update my cache after the save of an entity but I can't detect a delete reliable.

Thanks

Christoph

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 10-Jun-2008 05:15:13   

Hi Christoph, You have these overridable methods:

  • OnValidateEntityBeforeDelete(): just before delete occurs. Intended to validate entity.
  • OnDelete(): general purpose method, that happens just before delete occurs.
  • OnAuditDeleteOfEntity(): just after delete occurs. (only if delete success)
  • OnDeleteComplete(): when the whole delete action finish. (no matter what).

I think it's not common your situation, however if you need to trap something outside the entity I think you could create your own Events and rise them at the override version of any of those methods.

David Elizondo | LLBLGen Support Team